v0.0.123
This commit is contained in:
parent
b0d3ce8c1c
commit
8ebda6fb3a
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user