This project tests various mechanisms for parsing JSON in Go. Commentary on each here: http://sean.lyn.ch/2015/02/parsing-json-in-go/
$ godep restore $ go build $ ./golang-json-experiment
Classes of mechanisms
strict_struct.go- Parsing JSON into predefined structures. This includes structure definitions generated by: gojson, json-to-go, jflect, and json-to-struct
loose_struct.go- Dealing with JSON that is parsed into the empty interface.
wrapper.go- Using empty interface wrapping packages to handle type conversion. This includes: typed, go-simplejson, and jason
compiled.go- Using tools to pre-compile JSON parsers for performance reasons.
Sample JSON used to test is included as raw JSON and Paw project.
At this time, only one sample JSON set is included:
- The Move API call from Battlesnake