spec: add clear(x) builtin, to clear map, zero content of slice · Issue #56351 · golang/go
There is no way to clear a map in Go. You can write for k := range m { delete(m, k) } but that only works if m does not contain any key values that contain NaNs. Based on the discussion in #55002, ...