☰
Debian Codegraph
@
1.12.0-2
1.12.0-1
/
/
internal
/
engine
/
wazevo
/
wazevoapi
/
resetmap.go
☽
☼
internal/engine/wazevo/wazevoapi/resetmap.go
code
plain
raw
Apache-2.0
2020-2026 Tetrate.io, Inc.
debian/copyright
1
package wazevoapi
2
3
// ResetMap resets the map to an empty state, or creates a new map if it is nil.
4
func ResetMap[K comparable, V any](m map[K]V) map[K]V {
5
if m == nil {
6
m = make(map[K]V)
7
} else {
8
clear(m)
9
}
10
return m
11
}