I have some JSON data that I've un-marshalled into a map called data_json. It contains several hundred items.
Using the following code I can successfully retrieve the value of "dn" for one of the items in the map, however I'm struggling how to iterate over the entire structure to get the value for "dn" for all items in the map.
objects := data_json["data"].([]interface{})
first := objects[0].(map[string]interface{})
fmt.Println(first["dn"])
I've tried this type of approach but I'm confused as to how I should construct keys and values.
for v, k := range keys {
fmt.Println("Key:", k, "Value:", m[k])
}