Range over maps gives you keys and values:
ages := map[string]int{"Alice": 30, "Bob": 25}
for name, age := range ages {
fmt.Printf("%s is %d\n", name, age)
}
The iteration order is random. Go intentionally randomizes map iteration to prevent code from depending on a specific order. If you need order, sort the keys first.