MCPcopy
hub / github.com/tidwall/gjson / parseRecursiveDescent

Function parseRecursiveDescent

gjson.go:3585–3596  ·  view source on GitHub ↗
(all []Result, parent Result, path string)

Source from the content-addressed store, hash-verified

3583}
3584
3585func 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
3598func modDig(json, arg string) string {
3599 all := parseRecursiveDescent(nil, Parse(json), arg)

Callers 1

modDigFunction · 0.85

Calls 5

GetMethod · 0.80
ExistsMethod · 0.80
IsArrayMethod · 0.80
IsObjectMethod · 0.80
ForEachMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…