Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 960 Bytes

README.md

File metadata and controls

32 lines (20 loc) · 960 Bytes

go-jq Tests

Very simple command-line JSON processor written in Go.

Usage

  • clone the repo
  • go to cloned repo directory and run:
go build
echo "{\"id\":\"123\",\"type\":\"event\",\"repo\":{\"id\":\"2222\",\"type\":\"private\"},\"events\":[{\"id\":\"1\"},{\"id\":\"2\"}],\"test\":[[1,2,3],[4,5,6]]}" | ./go-jq '.repo'

screenshot

echo "{\"id\":\"123\",\"type\":\"event\",\"repo\":{\"id\":\"2222\",\"type\":\"private\"},\"events\":[{\"id\":\"1\"},{\"id\":\"2\"}],\"test\":[[1,2,3],[4,5,6]]}" | ./go-jq '.repo.type'

screenshot

echo "{\"id\":\"123\",\"type\":\"event\",\"repo\":{\"id\":\"2222\",\"type\":\"private\"},\"events\":[{\"id\":\"1\"},{\"id\":\"2\"}],\"test\":[[1,2,3],[4,5,6]]}" | ./go-jq '.test[0]'

screenshot