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