I'm new to Golang and I am trying to parse large json like the ones you get from an API which have lots of data. The documentation explains how to do this with any json:
b := []byte(`{"Name":"Wednesday","Age":6,"Parents":["Gomez","Morticia"]}`)
var f interface{}
err := json.Unmarshal(b, &f)
m := f.(map[string]interface{})
This works fine, but when I use a json that I get from the Twitter API, like the one at the end of the reference on the Twitter dev site I get this error:
interface conversion: interface {} is []interface {}, not map[string]interface {}
I know that there are similar questions but I couldn't find the answer. Can someone recommend me the better way to solve this?
My go version go1.6.2 linux/amd64.
Thanks !