jsonparser
jsonparser copied to clipboard
Arrayeach early termination
Description: What this PR does Added ability to terminate ArrayEach() from within its callback, by setting error to some value. Previous implementation didn't make much sense, since error was always nil.
Benchmark before change: Benchmark is currently broken, but this fix should not change benchmark times in any way. Might fix benchmark later.
Benchmark after change:
For running benchmarks use:
go test -test.benchmem -bench JsonParser ./benchmark/ -benchtime 5s -v
# OR
make bench (runs inside docker)
@xphil I just noticed this PR, after I opened https://github.com/buger/jsonparser/pull/156
What do you think of that patch? It's a similar goal as this one except it has the callback return an error. I also fixed the benchmarks to get them to run again.