mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 00:55:59 +08:00
feat: merge v3dev into main
This commit is contained in:
@@ -543,3 +543,15 @@ func Batch[T any, V any](fn func(T) V, ts []T) []V {
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func InitSlice[T any](val *[]T) {
|
||||
if val != nil && *val == nil {
|
||||
*val = []T{}
|
||||
}
|
||||
}
|
||||
|
||||
func InitMap[K comparable, V any](val *map[K]V) {
|
||||
if val != nil && *val == nil {
|
||||
*val = map[K]V{}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user