stretchr / objx

Go package for dealing with maps, slices, JSON and other data.
MIT License
695 stars 75 forks source link

ObjxMapSlice value #16

Closed onrik closed 6 years ago

onrik commented 9 years ago
package main

import (
    "fmt"
    "github.com/stretchr/objx"
)

var data = `
{
    "codes": [{"code": "34"}, {"code": "3254"}]
}
`

func main() {
    obj, err := objx.FromJSON(data)
    fmt.Println(err, obj.Get("codes").ObjxMapSlice()) // <nil> []
}