3 ms·
Did you get a chance to look into encoding/json package[1]? I come from Java background and have extensively used Gson in projects, I found encoding/json at par
by thezelus 12y ago
Did you get a chance to look into encoding/json package[1]? I come from Java background and have extensively used Gson in projects, I found encoding/json at par with Gson. You can find more examples here[2].
Would you mind if I ask what did you find lacking in Go's json package when compared to Gson?
[1] http://golang.org/pkg/encoding/json/ http://golang.org/pkg/encoding/json/
[2] http://www.attilaolah.eu/2013/11/29/json-decoding-in-go/ http://www.attilaolah.eu/2013/11/29/json-decoding-in-go/
- swah 12y agoThat's exactly what he is talking about. In a dynamic language, you just parse the JSON and access the resulting object. In Go, you need to have a matching record or use the interface type and implement a decoder.
- thezelus 12y agoOh, apologies. I thought he is talking about Gson[1], and hence the comment. 1. https://code.google.com/p/google-gson/ https://code.google.com/p/google-gson/