No description, website, or topics provided.
Go
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.travis.yml
README.md
example_test.go
scan.go
scan_test.go

README.md

go-scan

Build Status Coverage Status

Easily way to get the elements via xpath like string

Usage

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"]

Install

go get github.com/mattn/go-scan

License

MIT: http://mattn.mit-license.org/2013

Author

Yasuhiro Matsumoto (mattn.jp@gmail.com)