2 ms·
This is very useful, thanks! Go's slow JSON parser is annoying. My only criticism is that returning 4 values from a function is not very ergonomic, especially
by lobster_johnson 11y ago
This is very useful, thanks! Go's slow JSON parser is annoying.
My only criticism is that returning 4 values from a function is not very ergonomic, especially since most of the return values aren't needed in many cases.
It would have been better and more idiomatic to return a struct. Alternatively, let it take a pointer to a struct — this would let you avoid memory allocation in loops (though in theory Go should be able to optimize a struct return, too; anyone know?).
- LeonidBugaev 11y agoGood point, i will think how to make it work.