INNER CODE UNIT · Go
index
itaysk/kubectl-neat · cmd/neat.go:190
index := -1
cur.ForEach(func(k gjson.Result, v gjson.Result) bool {
var newPath string
if cur.IsArray() {
index++
newPath = fmt.Sprintf("%s.%d", path, index)
} else {
newPath = fmt.Sprintf("%s.%s", path, k.Str)
}
findEmptyPathsRecursive(v, newPath, res)
return true
})
}
func isResultEmpty(j gjson.Result) bool {
v := j.Value()
switch vt := v.(type) {
// empty string != lack of string. keep empty strings as it's meaningful data