json

Alternative Go JSON parser

OTHER License

Stars
10

Alternative Go JSON parser

features

Supported types to unmarshal into:

  • int
  • float64
  • string
  • bool
  • RawMessage
  • structs made of all of these
  • slices made of all of these
  • pointers to all of these
  • map[string]{all of these}

Other basic types would be easy to add; I have not needed them yet. Note that the empty interface is not supported.

vs. encoding/json

  • this works on a string, not a []byte
  • encoding/json has nice error messages
  • encoding/json can decode to the empty interface
  • encoding/json supports the Unmarshaler interface

performance

For the use case I'm mostly interested in (parsing openRTB requests) I get twice the performance and half the allocs:

Similar for parsing large ElasticSearch bulk results:

status

Works fine for us.

Badges
Extracted from project README
Build Status GoDoc