Easily way to get the elements via xpath like string
var js = strings.NewReader(`
{
"foo": {
"bar": [
{
"faz": true,
"moo": ["goo", "mar"]
},
{
"maz": true,
"moo": ["foo", "bar"]
}
]
}
}
`)
var s []string
scan.ScanJSON(js, "/foo/bar[1]/moo", &s) // s should be ["foo", "bar"]
go get github.com/mattn/go-scan
MIT: http://mattn.mit-license.org/2013
Yasuhiro Matsumoto (mattn.jp@gmail.com)