diff --git a/Makefile b/Makefile index 4faf1c21d..89b9e4152 100644 --- a/Makefile +++ b/Makefile @@ -184,7 +184,7 @@ test-e2e: imports: @$(MAKE) go.imports -## clean: Remove all files that are created by building. ✨ +## clean: Delete all files created by the build, as well as all log files. ✨ .PHONY: clean clean: @$(MAKE) go.clean diff --git a/internal/api/msg.go b/internal/api/msg.go index ca30131e7..1bbcf5428 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -308,7 +308,6 @@ func (m *MessageApi) BatchSendMsg(c *gin.Context) { } var recvIDs []string - var err error if req.IsSendAll { pageNumber := 1 showNumber := 500 diff --git a/pkg/common/db/controller/auth.go b/pkg/common/db/controller/auth.go index 909518f59..13bc066ca 100644 --- a/pkg/common/db/controller/auth.go +++ b/pkg/common/db/controller/auth.go @@ -47,12 +47,12 @@ func NewAuthDatabase(cache cache.MsgModel, accessSecret string, accessExpire int return &authDatabase{cache: cache, accessSecret: accessSecret, accessExpire: accessExpire} } -// If the result is empty +// If the result is empty. func (a *authDatabase) GetTokensWithoutError(ctx context.Context, userID string, platformID int) (map[string]int, error) { return a.cache.GetTokensWithoutError(ctx, userID, platformID) } -// Create Token +// Create Token. func (a *authDatabase) CreateToken(ctx context.Context, userID string, platformID int) (string, error) { tokens, err := a.cache.GetTokensWithoutError(ctx, userID, platformID) if err != nil { diff --git a/pkg/common/db/controller/friend.go b/pkg/common/db/controller/friend.go index 2e3b628a6..bb5ec3087 100644 --- a/pkg/common/db/controller/friend.go +++ b/pkg/common/db/controller/friend.go @@ -113,7 +113,7 @@ func (f *friendDatabase) CheckIn(ctx context.Context, userID1, userID2 string) ( return inUser1Friends, inUser2Friends, nil } -// AddFriendRequest adds or updates a friend request +// AddFriendRequest adds or updates a friend request. func (f *friendDatabase) AddFriendRequest(ctx context.Context, fromUserID, toUserID string, reqMsg string, ex string) (err error) { return f.tx.Transaction(ctx, func(ctx context.Context) error { _, err := f.friendRequest.Take(ctx, fromUserID, toUserID) @@ -197,7 +197,7 @@ func (f *friendDatabase) RefuseFriendRequest(ctx context.Context, friendRequest // Log the action of refusing the friend request for debugging and auditing purposes. log.ZDebug(ctx, "Refusing friend request", map[string]interface{}{ - "DB_FriendRequest": fr, + "DB_FriendRequest": fr, "Arg_FriendRequest": friendRequest, }) diff --git a/pkg/common/db/controller/msg.go b/pkg/common/db/controller/msg.go index 0a440eedf..add9b63ce 100644 --- a/pkg/common/db/controller/msg.go +++ b/pkg/common/db/controller/msg.go @@ -753,7 +753,7 @@ func (db *commonMsgDatabase) UserMsgsDestruct(ctx context.Context, userID string log.ZError(ctx, "deleteMsgRecursion GetUserMsgListByIndex failed", err, "conversationID", conversationID, "index", index) } } - // If an error is reported, or the error cannot be obtained, it is physically deleted and seq delMongoMsgsPhysical(delStruct.delDocIDList) is returned to end the recursion + // If an error is reported, or the error cannot be obtained, it is physically deleted and seq delMongoMsgsPhysical(delStruct.delDocIDList) is returned to end the recursion break } index++ diff --git a/pkg/rpcclient/notification/conversation.go b/pkg/rpcclient/notification/conversation.go index 58f00915a..3bbad746e 100644 --- a/pkg/rpcclient/notification/conversation.go +++ b/pkg/rpcclient/notification/conversation.go @@ -31,7 +31,7 @@ func NewConversationNotificationSender(msgRpcClient *rpcclient.MessageRpcClient) return &ConversationNotificationSender{rpcclient.NewNotificationSender(rpcclient.WithRpcClient(msgRpcClient))} } -// SetPrivate invote +// SetPrivate invote. func (c *ConversationNotificationSender) ConversationSetPrivateNotification(ctx context.Context, sendID, recvID string, isPrivateChat bool, conversationID string, ) error { diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk index 915639b61..5a5d1a788 100644 --- a/scripts/make-rules/golang.mk +++ b/scripts/make-rules/golang.mk @@ -17,7 +17,7 @@ # GO := go -GO_SUPPORTED_VERSIONS ?= 1.19|1.20|1.21|1.22 +GO_SUPPORTED_VERSIONS ?= 1.19|1.20|1.21|1.22|1.23 GO_LDFLAGS += -X $(VERSION_PACKAGE).gitVersion=$(GIT_TAG) \ -X $(VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) \ diff --git a/test/codescan/main.go b/test/codescan/main.go new file mode 100644 index 000000000..06ab7d0f9 --- /dev/null +++ b/test/codescan/main.go @@ -0,0 +1 @@ +package main