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

Method All

gjson.go:3618–3622  ·  view source on GitHub ↗

All iterates over a json result. This works identically to ForEach, but allows modern Go loops: for key, value := range res.All() { fmt.Printf("%s %s\n", key, value) }

()

Source from the content-addressed store, hash-verified

3616// fmt.Printf("%s %s\n", key, value)
3617// }
3618func (t Result) All() iter.Seq2[Result, Result] {
3619 return func(yield func(Result, Result) bool) {
3620 t.ForEach(yield)
3621 }
3622}
3623
3624// Keys iterates over a json result.
3625// This works identically to ForEach, but allows modern Go loops:

Callers 1

TestIterFunction · 0.80

Calls 1

ForEachMethod · 0.95

Tested by 1

TestIterFunction · 0.64