I would like to retrieve all IDs and also the index value.
{
"results": [
{
"ID": "3b72"
},
{
"ID": "d953b1"
},
{
"ID": "8eac"
},
{
"ID": "00b4c"
},
{
"ID": "22360"
}
],
"index": 10
}
I tried the following but no success ( I am quite new in golang):
var result map[string]interface{}
json.Unmarshal([]byte(body), &result)
ids:= result["results"].(map[string]interface{})
for key, value := range ids{
fmt.Println(key, value.(string))
}