Closed thedevsaddam closed 5 years ago
Usages Code of Out method:
Out
package main import ( "github.com/davecgh/go-spew/spew" "github.com/thedevsaddam/gojsonq" ) type item struct { ID int `json:"id"` Name string `json:"name"` Price float64 `json:"price"` } func main() { v := item{} jq := gojsonq.New().File("./data.json").From("items.[0]") jq.Out(&v) if jq.Error() != nil { panic(jq.Error()) } spew.Dump(v) } // Output: // (main.item) { // ID: (int) 1, // Name: (string) (len=26) "MacBook Pro 13 inch retina", // Price: (float64) 1350 // }
Usages Code of
Out
method: