(all []Result, parent Result, path string)
| 3583 | } |
| 3584 | |
| 3585 | func parseRecursiveDescent(all []Result, parent Result, path string) []Result { |
| 3586 | if res := parent.Get(path); res.Exists() { |
| 3587 | all = append(all, res) |
| 3588 | } |
| 3589 | if parent.IsArray() || parent.IsObject() { |
| 3590 | parent.ForEach(func(_, val Result) bool { |
| 3591 | all = parseRecursiveDescent(all, val, path) |
| 3592 | return true |
| 3593 | }) |
| 3594 | } |
| 3595 | return all |
| 3596 | } |
| 3597 | |
| 3598 | func modDig(json, arg string) string { |
| 3599 | all := parseRecursiveDescent(nil, Parse(json), arg) |