golang-json-experiment
This project tests various mechanisms for parsing JSON in Go. Commentary on each here: http://sean.lyn.ch/2015/02/parsing-json-in-go/
To run:
$ 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-structloose_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- TODO
compiled.go
- Using tools to pre-compile JSON parsers for performance reasons.
Sample data
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