Json2Struct
Github
Linkedin
Golang: Convert JSON in to a useful struct.
Raw JSON Input
{ "example": { "from": { "path": "/example.json" } } }
Go Struct Output
package main type MyJsonName struct { Example struct { From struct { Path string `json:"path"` } `json:"from"` } `json:"example"` }
Notes:
Also supports loading from remote json via the
src
param. Example:
http://json2struct.mervine.net?src=http://json2struct.mervine.net/example.json
See an example in Go Playground:
http://play.golang.org/p/usdLCoVEZR
.
Fork me @
github.com/jmervine/gojson-http