mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 10:52:33 +08:00
update user command
This commit is contained in:
parent
3c57baec6b
commit
73b8f76185
@ -375,8 +375,8 @@ func (s *userServer) ProcessUserCommandGet(ctx context.Context, req *pbuser.Proc
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Create a slice to store CommandInfoResp
|
||||
commandInfoSlice := []*pbuser.CommandInfoResp{}
|
||||
// Initialize commandInfoSlice as an empty slice
|
||||
commandInfoSlice := make([]*pbuser.CommandInfoResp, 0, len(commands))
|
||||
|
||||
for _, v := range commands {
|
||||
commandInfoSlice = append(commandInfoSlice, &pbuser.CommandInfoResp{
|
||||
@ -386,6 +386,6 @@ func (s *userServer) ProcessUserCommandGet(ctx context.Context, req *pbuser.Proc
|
||||
})
|
||||
}
|
||||
|
||||
// Return the new slice
|
||||
// Return the response with the slice, which is empty but not nil if there are no commands
|
||||
return &pbuser.ProcessUserCommandGetResp{KVArray: commandInfoSlice}, nil
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user