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.
|
||||
func (p Path) String() string {
|
||||
if len(p) == 0 {
|
||||
return "."
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
|
||||
for i, c := range p {
|
||||
if i > 0 && c.key != "" {
|
||||
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"))
|
||||
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