"github.com/tomwright/dasel"
_ = json.Unmarshal([]byte(`[{"name": "Tom"}, {"name": "Jim"}]`), &data)
rootNode := dasel.New(data)
result, _ := rootNode.Query(".[0].name")
printNodeValue(result) // Tom
results, _ := rootNode.QueryMultiple(".[*].name")
printNodeValue(results...) // Tom\nJim
_ = rootNode.Put(".[0].name", "Frank")
printNodeValue(rootNode) // [map[name:Frank] map[name:Jim]]
_ = rootNode.PutMultiple(".[*].name", "Joe")
printNodeValue(rootNode) // [map[name:Joe] map[name:Joe]]
outputBytes, _ := json.Marshal(rootNode.InterfaceValue())
fmt.Println(string(outputBytes)) // [{"name":"Joe"},{"name":"Joe"}]
func printNodeValue(nodes ...*dasel.Node) {
for _, n := range nodes {
fmt.Println(n.InterfaceValue())