makelint internal/ (#1951)

Signed-off-by: xuan <146319162+wxuanF@users.noreply.github.com>
This commit is contained in:
xuan
2024-02-25 22:23:29 +08:00
committed by GitHub
parent 3c1d096e99
commit b13f2614b8
6 changed files with 78 additions and 77 deletions
+2 -2
View File
@@ -58,12 +58,12 @@ func (u *UserMap) Get(key string, platformID int) ([]*Client, bool, bool) {
func (u *UserMap) Set(key string, v *Client) {
allClients, existed := u.m.Load(key)
if existed {
log.ZDebug(context.Background(), "Set existed", "user_id", key, "client", *v)
log.ZDebug(context.Background(), "Set existed", "user_id", key, "client_user_id", v.UserID)
oldClients := allClients.([]*Client)
oldClients = append(oldClients, v)
u.m.Store(key, oldClients)
} else {
log.ZDebug(context.Background(), "Set not existed", "user_id", key, "client", *v)
log.ZDebug(context.Background(), "Set not existed", "user_id", key, "client_user_id", v.UserID)
var clients []*Client
clients = append(clients, v)
u.m.Store(key, clients)