Keys iterates over a json result. This works identically to ForEach, but allows modern Go loops: for key := range res.Keys() { fmt.Printf("%s\n", key) }
()
| 3628 | // fmt.Printf("%s\n", key) |
| 3629 | // } |
| 3630 | func (t Result) Keys() iter.Seq[Result] { |
| 3631 | return func(yield func(Result) bool) { |
| 3632 | t.ForEach(func(key, _ Result) bool { |
| 3633 | return yield(key) |
| 3634 | }) |
| 3635 | } |
| 3636 | } |
| 3637 | |
| 3638 | // Values iterates over a json result. |
| 3639 | // This works identically to ForEach, but allows modern Go loops: |