This commit is contained in:
2023-05-25 18:20:31 +02:00
parent b0d3ce8c1c
commit 8ebda6fb3a

View File

@@ -47,3 +47,11 @@ func CopyMap[K comparable, V any](a map[K]V) map[K]V {
}
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
}
}