mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 09:36:00 +08:00
msg cb
This commit is contained in:
@@ -425,3 +425,11 @@ func Unwrap(err error) error {
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// NotNilReplace 当new_不为空时, 将old设置为new_
|
||||
func NotNilReplace[T any](old, new_ *T) {
|
||||
if old == nil || new_ == nil {
|
||||
return
|
||||
}
|
||||
*old = *new_
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user