I'm having an issue when I'm try to iterate through a map of some json.
The original JSON data looks like this:
"dataArray": [
{
"name": "default",
"url": "/some/url"
},
{
"name": "second",
"url": "/another/url"
}
]
the map looks like this:
[map[name:default url:/some/url] map[name:second url:/another/url]]
The code looks like this:
for _, urlItem := range item.(map[string]interface{}){
do some stuff
}
This normally works when it's a JSON object, but this is an array in the JSON and I get the following error:
panic: interface conversion: interface {} is []interface {}, not map[string]interface {}
Any help would be greatly appreciated