This commit is contained in:
Mike Schwörer 2023-05-25 18:20:31 +02:00
parent b0d3ce8c1c
commit 8ebda6fb3a
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -47,3 +47,11 @@ func CopyMap[K comparable, V any](a map[K]V) map[K]V {
} }
return result return result
} }
func ForceMap[K comparable, V any](v map[K]V) map[K]V {
if v == nil {
return make(map[K]V, 0)
} else {
return v
}
}