mirror of https://github.com/databricks/cli.git
removed path changes
This commit is contained in:
parent
d4a334696e
commit
82d6640170
|
@ -91,11 +91,8 @@ func (p Path) HasPrefix(q Path) bool {
|
||||||
|
|
||||||
// String returns a string representation of the path.
|
// String returns a string representation of the path.
|
||||||
func (p Path) String() string {
|
func (p Path) String() string {
|
||||||
if len(p) == 0 {
|
|
||||||
return "."
|
|
||||||
}
|
|
||||||
|
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
|
|
||||||
for i, c := range p {
|
for i, c := range p {
|
||||||
if i > 0 && c.key != "" {
|
if i > 0 && c.key != "" {
|
||||||
buf.WriteRune('.')
|
buf.WriteRune('.')
|
||||||
|
|
|
@ -72,7 +72,3 @@ func TestPathString(t *testing.T) {
|
||||||
p3 := dyn.NewPath(dyn.Key("foo"), dyn.Index(1), dyn.Key("bar"), dyn.Index(2), dyn.Key("baz"))
|
p3 := dyn.NewPath(dyn.Key("foo"), dyn.Index(1), dyn.Key("bar"), dyn.Index(2), dyn.Key("baz"))
|
||||||
assert.Equal(t, "foo[1].bar[2].baz", p3.String())
|
assert.Equal(t, "foo[1].bar[2].baz", p3.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPathStringEmpty(t *testing.T) {
|
|
||||||
assert.Equal(t, ".", dyn.EmptyPath.String())
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue