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!
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!