Use the delete function to remove a key-value pair:
ages := map[string]int{"Alice": 30, "Bob": 25}
delete(ages, "Alice")
// ages is now {"Bob": 25}
Deleting a key that doesn't exist is safe. It does nothing and doesn't panic. This means you don't need to check if a key exists before deleting it.