Use the comma-ok idiom to check if a key exists:
ages := map[string]int{"Alice": 30}
age, ok := ages["Alice"]
// age = 30, ok = true
age, ok = ages["Carol"]
// age = 0, ok = false
The second return value is a boolean. It's true if the key exists, false otherwise. This distinguishes between "key not found" and "key exists with zero value".