MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / AllPathsWithDepth

Function AllPathsWithDepth

pkg/util/json/json.go:1806–1808  ·  view source on GitHub ↗

AllPathsWithDepth returns a slice of new JSON documents, each a path through the receiver. The depth parameter specifies the maximum depth of the paths to return. If the depth is negative, all paths of any depth are returned. If the depth is 0, the receiver itself is returned. Note that leaves inclu

(j JSON, depth int)

Source from the content-addressed store, hash-verified

1804// returned. If the depth is 0, the receiver itself is returned. Note that
1805// leaves include the empty object and array in addition to scalars.
1806func AllPathsWithDepth(j JSON, depth int) ([]JSON, error) {
1807 return j.allPathsWithDepth(depth)
1808}
1809
1810func (j jsonNull) allPathsWithDepth(depth int) ([]JSON, error) {
1811 return []JSON{j}, nil

Callers

nothing calls this directly

Calls 1

allPathsWithDepthMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…