FAQ
I am writing this post because it seems that the GO JSON encoder is not a truly streaming encoder.
No it isn't, nor does it claim to be (that I can find).

The encoder marshals (and buffers) an entire object at a time. If you
have a slice of 10k items you want to send as a JSON array, you can do
the array encoding yourself: send a "[", then encode each item with a
"," in between, then a final "]".

http://play.golang.org/p/NTLgY2CRXp

-Caleb

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 7 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 2, '15 at 7:09p
activeDec 4, '15 at 3:17a
posts7
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase