Key-value pairs are removed from a map via the built-in delete function:
m := map[string]int{
"hello": 5,
"world": 10,
}
delete(m, "hello")
The delete function takes a map and a key and then removes the key-value pair with the specified key. If the key isn’t present in the map or if the map is nil, nothing happens. The delete function doesn’t return a value.
Progress is saved on this device.