News for hackers. Stuff that matters.
Re:Show HN: Jason – A new JSON Library for Go by chimeracoder on Tuesday December 02, 2014 @11:56AM (#8688072)
This looks like a good approach to dealing with heterogeneous JSON! (ie, JSON that has an unknown and/or variable structure.) I've always found encoding/json a little clunky for this.

Shameless but relevant plug - if you do know the structure of your JSON in advance, I wrote a tool for automatically generating the appropriate struct definition for it: https://github.com/ChimeraCoder/gojson

(I see these as complimentary tools, rather than conflicting or competing, since they would have two different use cases).

Re:Show HN: Jason – A new JSON Library for Go by endymi0n on Tuesday December 02, 2014 @12:18PM (#8688256)
This.

If your main use case is JSON as a serialized representation of the ever same object (plus or minus a few optional fields), encoding/json is by far the fastest and most typesafe way to go.

(edit: Protip - for the really really fastest way to demarshal JSON, look here https://github.com/pquerna/ffjson for some reflection-free extra speed after your code has settled down)

But if your objects can be heterogenous for whatever reasons (think third-party systems, different languages, legacy stacks...) or you're dealing with different kinds of objects landing on the same controller, jason is the perfect complimentary device to deal with more dynamic structures. I've long sought for something like this, thanks to the OP!

Re:Show HN: Jason – A new JSON Library for Go by mholt on Tuesday December 02, 2014 @12:24PM (#8688308)
(Another plug here) I did too! Except it runs in the browser: https://mholt.github.io/json-to-go

And I agree with you about the complementary aspect. Sometimes you can't control the fact that your JSON will have a widely varying structure... but when you can, these generators are nice.

Re:Show HN: Jason – A new JSON Library for Go by antonholmquist on Thursday December 04, 2014 @07:40AM (#8698952)
Seems very handy! Thank you
Re:Show HN: Jason – A new JSON Library for Go by anonfunction on Tuesday December 02, 2014 @10:35PM (#8691763)
Great tool!