mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 13:48:06 +00:00
Merge branch 'fix-merge-with-dots' of git://github.com/coryrc/yq into coryrc-fix-merge-with-dots
This commit is contained in:
commit
de3bfaef60
@ -1412,7 +1412,7 @@ c:
|
|||||||
toast: leave
|
toast: leave
|
||||||
test: 1
|
test: 1
|
||||||
tell: 1
|
tell: 1
|
||||||
taco: cool
|
tasty.taco: cool
|
||||||
`
|
`
|
||||||
filename := test.WriteTempYamlFile(content)
|
filename := test.WriteTempYamlFile(content)
|
||||||
defer test.RemoveTempYamlFile(filename)
|
defer test.RemoveTempYamlFile(filename)
|
||||||
@ -1427,7 +1427,7 @@ c:
|
|||||||
b: [3, 4]
|
b: [3, 4]
|
||||||
c:
|
c:
|
||||||
toast: leave
|
toast: leave
|
||||||
taco: cool
|
tasty.taco: cool
|
||||||
`
|
`
|
||||||
test.AssertResult(t, expectedOutput, result.Output)
|
test.AssertResult(t, expectedOutput, result.Output)
|
||||||
}
|
}
|
||||||
@ -1593,7 +1593,7 @@ c:
|
|||||||
test: 1
|
test: 1
|
||||||
toast: leave
|
toast: leave
|
||||||
tell: 1
|
tell: 1
|
||||||
taco: cool
|
tasty.taco: cool
|
||||||
`
|
`
|
||||||
test.AssertResult(t, expectedOutput, result.Output)
|
test.AssertResult(t, expectedOutput, result.Output)
|
||||||
}
|
}
|
||||||
@ -1794,7 +1794,7 @@ c:
|
|||||||
test: 1
|
test: 1
|
||||||
toast: leave
|
toast: leave
|
||||||
tell: 1
|
tell: 1
|
||||||
taco: cool
|
tasty.taco: cool
|
||||||
`
|
`
|
||||||
test.AssertResult(t, expectedOutput, gotOutput)
|
test.AssertResult(t, expectedOutput, gotOutput)
|
||||||
test.AssertResult(t, os.FileMode(int(0666)), info.Mode())
|
test.AssertResult(t, os.FileMode(int(0666)), info.Mode())
|
||||||
|
@ -4,4 +4,4 @@ c:
|
|||||||
toast: leave
|
toast: leave
|
||||||
test: 1
|
test: 1
|
||||||
tell: 1
|
tell: 1
|
||||||
taco: cool
|
tasty.taco: cool
|
||||||
|
@ -51,7 +51,15 @@ func mergePathStackToString(pathStack []interface{}, appendArrays bool) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
sb.WriteString(fmt.Sprintf("%v", path))
|
s := fmt.Sprintf("%v", path)
|
||||||
|
hasDot := strings.Contains(s, ".")
|
||||||
|
if hasDot {
|
||||||
|
sb.WriteString("[")
|
||||||
|
}
|
||||||
|
sb.WriteString(s)
|
||||||
|
if hasDot {
|
||||||
|
sb.WriteString("]")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if index < len(pathStack)-1 {
|
if index < len(pathStack)-1 {
|
||||||
|
Loading…
Reference in New Issue
Block a user