Files
tinygo/src/sync/map_go123.go
T
Ayke van Laethem 250426c1e5 sync: add Map.Clear()
This was added in Go 1.23 and is needed for the net/mail package.
2024-08-17 11:49:14 +02:00

14 lines
277 B
Go

//go:build go1.23
package sync
// Go 1.23 added the Clear() method. The clear() function is added in Go 1.21,
// so this method can be moved to map.go once we drop support for Go 1.20 and
// below.
func (m *Map) Clear() {
m.lock.Lock()
defer m.lock.Unlock()
clear(m.m)
}