48
GitHub - itchyny/gojq: Yet another Go implementation of jq
source link: https://github.com/itchyny/gojq
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
gojq
Yet another Go implementation of jq.
Usage
$ echo '{"foo": 128}' | gojq '.foo' 128 $ echo '{"a": {"b": 42}}' | gojq '.a.b' 42 $ echo '{"id": "sample", "10": {"b": 42}}' | gojq '{(.id): .["10"].b}' { "sample": 42 } $ echo '[{"id":1},{"id":2},{"id":3}]' | gojq '.[] | .id' 1 2 3
Nice error messages.
$ echo '[1,2,3]' | gojq '.foo & .bar' gojq: invalid query: .foo & .bar .foo & .bar ^ unexpected token "&" $ echo '{"foo": { bar: [] } }' | gojq '.' gojq: invalid json: invalid character 'b' looking for beginning of object key string {"foo": { bar: [] } } ^
Installation
Homebrew
brew install itchyny/tap/gojq
Build from source
go get -u github.com/itchyny/gojq/cmd/gojq
Bug Tracker
Report bug at Issues・itchyny/gojq - GitHub.
Author
itchyny (https://github.com/itchyny)
License
This software is released under the MIT License, see LICENSE.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK