jsonq icon indicating copy to clipboard operation
jsonq copied to clipboard

Add iterator

Open macdabby opened this issue 7 years ago • 1 comments

It would be great to have a .each(func(interface{}, string)) method that would pass each value and key to a closure. I'll do my best to add this.

macdabby avatar Feb 23 '18 17:02 macdabby

(sorry i'm sort of a go noob)

it looks like this might not be necessary, maybe the following would work:

for i, v := range jq.Array("some", "array") {
    ....
}

And same with jq.Object()

It that works, it would be great to add that to the docs

macdabby avatar Feb 23 '18 18:02 macdabby