Merge branch 'fix-merge-with-dots' of git://github.com/coryrc/yq into coryrc-fix-merge-with-dots

This commit is contained in:
Mike Farah
2020-02-07 09:09:52 +11:00
3 changed files with 14 additions and 6 deletions
+9 -1
View File
@@ -51,7 +51,15 @@ func mergePathStackToString(pathStack []interface{}, appendArrays bool) string {
}
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 {