To get only map keys:
ages := map[string]int{"Alice": 30, "Bob": 25}
for name := range ages {
fmt.Println(name)
}
This prints just the names. Like with slices, omitting the second variable gives you only the first value. For maps, that's the key. Use this when you only need to check which keys exist.