mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 19:17:47 +00:00
sync: add Map.Clear()
This was added in Go 1.23 and is needed for the net/mail package.
This commit is contained in:
committed by
Ron Evans
parent
e300e90a63
commit
250426c1e5
@@ -0,0 +1,13 @@
|
||||
//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)
|
||||
}
|
||||
Reference in New Issue
Block a user