Skip to content

Instantly share code, notes, and snippets.

@thedevsaddam
Last active July 10, 2018 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedevsaddam/e11a44de73fe4ae73f54dc1f25501981 to your computer and use it in GitHub Desktop.
Save thedevsaddam/e11a44de73fe4ae73f54dc1f25501981 to your computer and use it in GitHub Desktop.
access data using Find method
package main
import (
"fmt"
"log"
"github.com/thedevsaddam/gojsonq"
)
func main() {
jq := gojsonq.New().File("./sample-data.json")
res := jq.Find("vendor.items.[1].name")
if jq.Error() != nil {
log.Fatal(jq.Errors())
}
fmt.Println(res)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment