From 4c34647ccf76113deb1426075bc124fd4954013a Mon Sep 17 00:00:00 2001 From: AndrewZuo01 Date: Tue, 12 Dec 2023 16:41:14 +0800 Subject: [PATCH] update user command --- pkg/common/db/mgo/user.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/common/db/mgo/user.go b/pkg/common/db/mgo/user.go index e1c9ffc90..19fd0e115 100644 --- a/pkg/common/db/mgo/user.go +++ b/pkg/common/db/mgo/user.go @@ -116,7 +116,8 @@ func (u *UserMgo) GetUserCommands(ctx context.Context, userID string, Type int32 } defer cursor.Close(ctx) - var commands []user.CommandInfoResp + // Initialize commands as an empty slice + commands := []user.CommandInfoResp{} for cursor.Next(ctx) { var document struct {