From 8b683ddccb9e5ba8e29efd34d921affa7c967249 Mon Sep 17 00:00:00 2001 From: a3d21 Date: Sun, 3 Dec 2023 22:28:37 +0800 Subject: [PATCH] disable .github --- {.github => .github_bak}/.codecov.yml | 0 {.github => .github_bak}/dependabot.yml | 0 {.github => .github_bak}/labels.yml | 0 {.github => .github_bak}/release-drafter.yml | 0 {.github => .github_bak}/sync-release.yml | 0 {.github => .github_bak}/sync.yml | 0 {.github => .github_bak}/weekly-digest.yml | 0 .../workflows/auto-assign-issue.yml | 0 .../workflows/auto-gh-pr.yml | 0 .../workflows/auto-invite.yml | 0 .../workflows/auto-tag.yml | 0 .../workflows/bot-auto-cherry-pick.yml | 0 .../workflows/bot-cherry-pick.yml | 0 .../workflows/build-docker-image.yml | 0 .../workflows/build-openim-web-image.yml | 0 .../workflows/check-coverage.yml | 0 {.github => .github_bak}/workflows/cla.yml | 0 .../workflows/codeql-analysis.yml | 0 .../workflows/create-branch-on-tag.yml | 0 .../workflows/depsreview.yaml | 0 .../workflows/docker-buildx.yml | 0 .../workflows/e2e-test.yml | 0 .../workflows/golangci-lint.yml | 0 {.github => .github_bak}/workflows/gosec.yml | 0 .../workflows/greetings.yml | 0 .../workflows/help-comment-issue.yml | 0 .../workflows/issue-robot.yml | 0 .../workflows/link-pr.yml | 0 .../workflows/lock-issue.yml | 0 .../workflows/milestone.yml | 0 .../workflows/opencommit.yml | 0 .../workflows/openimci.yml | 0 .../workflows/project-progress.yml | 0 .../workflows/pull-request.yml | 0 .../workflows/release-drafter.yml | 0 .../workflows/release.yml | 0 {.github => .github_bak}/workflows/stale.yml | 0 .../workflows/sync-release.yml | 0 {.github => .github_bak}/workflows/sync.yml | 0 out.txt | 4251 +++++++++++++++++ 40 files changed, 4251 insertions(+) rename {.github => .github_bak}/.codecov.yml (100%) rename {.github => .github_bak}/dependabot.yml (100%) rename {.github => .github_bak}/labels.yml (100%) rename {.github => .github_bak}/release-drafter.yml (100%) rename {.github => .github_bak}/sync-release.yml (100%) rename {.github => .github_bak}/sync.yml (100%) rename {.github => .github_bak}/weekly-digest.yml (100%) rename {.github => .github_bak}/workflows/auto-assign-issue.yml (100%) rename {.github => .github_bak}/workflows/auto-gh-pr.yml (100%) rename {.github => .github_bak}/workflows/auto-invite.yml (100%) rename {.github => .github_bak}/workflows/auto-tag.yml (100%) rename {.github => .github_bak}/workflows/bot-auto-cherry-pick.yml (100%) rename {.github => .github_bak}/workflows/bot-cherry-pick.yml (100%) rename {.github => .github_bak}/workflows/build-docker-image.yml (100%) rename {.github => .github_bak}/workflows/build-openim-web-image.yml (100%) rename {.github => .github_bak}/workflows/check-coverage.yml (100%) rename {.github => .github_bak}/workflows/cla.yml (100%) rename {.github => .github_bak}/workflows/codeql-analysis.yml (100%) rename {.github => .github_bak}/workflows/create-branch-on-tag.yml (100%) rename {.github => .github_bak}/workflows/depsreview.yaml (100%) rename {.github => .github_bak}/workflows/docker-buildx.yml (100%) rename {.github => .github_bak}/workflows/e2e-test.yml (100%) rename {.github => .github_bak}/workflows/golangci-lint.yml (100%) rename {.github => .github_bak}/workflows/gosec.yml (100%) rename {.github => .github_bak}/workflows/greetings.yml (100%) rename {.github => .github_bak}/workflows/help-comment-issue.yml (100%) rename {.github => .github_bak}/workflows/issue-robot.yml (100%) rename {.github => .github_bak}/workflows/link-pr.yml (100%) rename {.github => .github_bak}/workflows/lock-issue.yml (100%) rename {.github => .github_bak}/workflows/milestone.yml (100%) rename {.github => .github_bak}/workflows/opencommit.yml (100%) rename {.github => .github_bak}/workflows/openimci.yml (100%) rename {.github => .github_bak}/workflows/project-progress.yml (100%) rename {.github => .github_bak}/workflows/pull-request.yml (100%) rename {.github => .github_bak}/workflows/release-drafter.yml (100%) rename {.github => .github_bak}/workflows/release.yml (100%) rename {.github => .github_bak}/workflows/stale.yml (100%) rename {.github => .github_bak}/workflows/sync-release.yml (100%) rename {.github => .github_bak}/workflows/sync.yml (100%) create mode 100644 out.txt diff --git a/.github/.codecov.yml b/.github_bak/.codecov.yml similarity index 100% rename from .github/.codecov.yml rename to .github_bak/.codecov.yml diff --git a/.github/dependabot.yml b/.github_bak/dependabot.yml similarity index 100% rename from .github/dependabot.yml rename to .github_bak/dependabot.yml diff --git a/.github/labels.yml b/.github_bak/labels.yml similarity index 100% rename from .github/labels.yml rename to .github_bak/labels.yml diff --git a/.github/release-drafter.yml b/.github_bak/release-drafter.yml similarity index 100% rename from .github/release-drafter.yml rename to .github_bak/release-drafter.yml diff --git a/.github/sync-release.yml b/.github_bak/sync-release.yml similarity index 100% rename from .github/sync-release.yml rename to .github_bak/sync-release.yml diff --git a/.github/sync.yml b/.github_bak/sync.yml similarity index 100% rename from .github/sync.yml rename to .github_bak/sync.yml diff --git a/.github/weekly-digest.yml b/.github_bak/weekly-digest.yml similarity index 100% rename from .github/weekly-digest.yml rename to .github_bak/weekly-digest.yml diff --git a/.github/workflows/auto-assign-issue.yml b/.github_bak/workflows/auto-assign-issue.yml similarity index 100% rename from .github/workflows/auto-assign-issue.yml rename to .github_bak/workflows/auto-assign-issue.yml diff --git a/.github/workflows/auto-gh-pr.yml b/.github_bak/workflows/auto-gh-pr.yml similarity index 100% rename from .github/workflows/auto-gh-pr.yml rename to .github_bak/workflows/auto-gh-pr.yml diff --git a/.github/workflows/auto-invite.yml b/.github_bak/workflows/auto-invite.yml similarity index 100% rename from .github/workflows/auto-invite.yml rename to .github_bak/workflows/auto-invite.yml diff --git a/.github/workflows/auto-tag.yml b/.github_bak/workflows/auto-tag.yml similarity index 100% rename from .github/workflows/auto-tag.yml rename to .github_bak/workflows/auto-tag.yml diff --git a/.github/workflows/bot-auto-cherry-pick.yml b/.github_bak/workflows/bot-auto-cherry-pick.yml similarity index 100% rename from .github/workflows/bot-auto-cherry-pick.yml rename to .github_bak/workflows/bot-auto-cherry-pick.yml diff --git a/.github/workflows/bot-cherry-pick.yml b/.github_bak/workflows/bot-cherry-pick.yml similarity index 100% rename from .github/workflows/bot-cherry-pick.yml rename to .github_bak/workflows/bot-cherry-pick.yml diff --git a/.github/workflows/build-docker-image.yml b/.github_bak/workflows/build-docker-image.yml similarity index 100% rename from .github/workflows/build-docker-image.yml rename to .github_bak/workflows/build-docker-image.yml diff --git a/.github/workflows/build-openim-web-image.yml b/.github_bak/workflows/build-openim-web-image.yml similarity index 100% rename from .github/workflows/build-openim-web-image.yml rename to .github_bak/workflows/build-openim-web-image.yml diff --git a/.github/workflows/check-coverage.yml b/.github_bak/workflows/check-coverage.yml similarity index 100% rename from .github/workflows/check-coverage.yml rename to .github_bak/workflows/check-coverage.yml diff --git a/.github/workflows/cla.yml b/.github_bak/workflows/cla.yml similarity index 100% rename from .github/workflows/cla.yml rename to .github_bak/workflows/cla.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github_bak/workflows/codeql-analysis.yml similarity index 100% rename from .github/workflows/codeql-analysis.yml rename to .github_bak/workflows/codeql-analysis.yml diff --git a/.github/workflows/create-branch-on-tag.yml b/.github_bak/workflows/create-branch-on-tag.yml similarity index 100% rename from .github/workflows/create-branch-on-tag.yml rename to .github_bak/workflows/create-branch-on-tag.yml diff --git a/.github/workflows/depsreview.yaml b/.github_bak/workflows/depsreview.yaml similarity index 100% rename from .github/workflows/depsreview.yaml rename to .github_bak/workflows/depsreview.yaml diff --git a/.github/workflows/docker-buildx.yml b/.github_bak/workflows/docker-buildx.yml similarity index 100% rename from .github/workflows/docker-buildx.yml rename to .github_bak/workflows/docker-buildx.yml diff --git a/.github/workflows/e2e-test.yml b/.github_bak/workflows/e2e-test.yml similarity index 100% rename from .github/workflows/e2e-test.yml rename to .github_bak/workflows/e2e-test.yml diff --git a/.github/workflows/golangci-lint.yml b/.github_bak/workflows/golangci-lint.yml similarity index 100% rename from .github/workflows/golangci-lint.yml rename to .github_bak/workflows/golangci-lint.yml diff --git a/.github/workflows/gosec.yml b/.github_bak/workflows/gosec.yml similarity index 100% rename from .github/workflows/gosec.yml rename to .github_bak/workflows/gosec.yml diff --git a/.github/workflows/greetings.yml b/.github_bak/workflows/greetings.yml similarity index 100% rename from .github/workflows/greetings.yml rename to .github_bak/workflows/greetings.yml diff --git a/.github/workflows/help-comment-issue.yml b/.github_bak/workflows/help-comment-issue.yml similarity index 100% rename from .github/workflows/help-comment-issue.yml rename to .github_bak/workflows/help-comment-issue.yml diff --git a/.github/workflows/issue-robot.yml b/.github_bak/workflows/issue-robot.yml similarity index 100% rename from .github/workflows/issue-robot.yml rename to .github_bak/workflows/issue-robot.yml diff --git a/.github/workflows/link-pr.yml b/.github_bak/workflows/link-pr.yml similarity index 100% rename from .github/workflows/link-pr.yml rename to .github_bak/workflows/link-pr.yml diff --git a/.github/workflows/lock-issue.yml b/.github_bak/workflows/lock-issue.yml similarity index 100% rename from .github/workflows/lock-issue.yml rename to .github_bak/workflows/lock-issue.yml diff --git a/.github/workflows/milestone.yml b/.github_bak/workflows/milestone.yml similarity index 100% rename from .github/workflows/milestone.yml rename to .github_bak/workflows/milestone.yml diff --git a/.github/workflows/opencommit.yml b/.github_bak/workflows/opencommit.yml similarity index 100% rename from .github/workflows/opencommit.yml rename to .github_bak/workflows/opencommit.yml diff --git a/.github/workflows/openimci.yml b/.github_bak/workflows/openimci.yml similarity index 100% rename from .github/workflows/openimci.yml rename to .github_bak/workflows/openimci.yml diff --git a/.github/workflows/project-progress.yml b/.github_bak/workflows/project-progress.yml similarity index 100% rename from .github/workflows/project-progress.yml rename to .github_bak/workflows/project-progress.yml diff --git a/.github/workflows/pull-request.yml b/.github_bak/workflows/pull-request.yml similarity index 100% rename from .github/workflows/pull-request.yml rename to .github_bak/workflows/pull-request.yml diff --git a/.github/workflows/release-drafter.yml b/.github_bak/workflows/release-drafter.yml similarity index 100% rename from .github/workflows/release-drafter.yml rename to .github_bak/workflows/release-drafter.yml diff --git a/.github/workflows/release.yml b/.github_bak/workflows/release.yml similarity index 100% rename from .github/workflows/release.yml rename to .github_bak/workflows/release.yml diff --git a/.github/workflows/stale.yml b/.github_bak/workflows/stale.yml similarity index 100% rename from .github/workflows/stale.yml rename to .github_bak/workflows/stale.yml diff --git a/.github/workflows/sync-release.yml b/.github_bak/workflows/sync-release.yml similarity index 100% rename from .github/workflows/sync-release.yml rename to .github_bak/workflows/sync-release.yml diff --git a/.github/workflows/sync.yml b/.github_bak/workflows/sync.yml similarity index 100% rename from .github/workflows/sync.yml rename to .github_bak/workflows/sync.yml diff --git a/out.txt b/out.txt new file mode 100644 index 000000000..8946cf3d0 --- /dev/null +++ b/out.txt @@ -0,0 +1,4251 @@ +internal/api/custom_validator.go:37:2: return with no blank line before (nlreturn) + return true + ^ +internal/api/msg.go:56:39: `(MessageApi).newUserSendMsgReq` - `c` is unused (unparam) +func (m MessageApi) newUserSendMsgReq(c *gin.Context, params *apistruct.SendMsg) *msg.SendMsgReq { + ^ +internal/api/msg.go:202:2: return with no blank line before (nlreturn) + return m.newUserSendMsgReq(c, &req), nil + ^ +internal/api/msg.go:209:3: return with no blank line before (nlreturn) + return + ^ +internal/api/msg.go:213:3: return with no blank line before (nlreturn) + return + ^ +internal/api/msg.go:220:3: return with no blank line before (nlreturn) + return + ^ +internal/api/msg.go:226:3: ineffectual assignment to status (ineffassign) + status = constant.MsgSendFailed + ^ +internal/api/msg.go:229:3: return with no blank line before (nlreturn) + return + ^ +internal/api/msg.go:250:3: return with no blank line before (nlreturn) + return + ^ +internal/api/msg.go:254:3: return with no blank line before (nlreturn) + return + ^ +internal/api/msg.go:281:3: return with no blank line before (nlreturn) + return + ^ +internal/api/msg.go:294:3: return with no blank line before (nlreturn) + return + ^ +internal/api/msg.go:299:3: return with no blank line before (nlreturn) + return + ^ +internal/api/msg.go:308:17: shadow: declaration of "err" shadows declaration at line 303 (govet) + recvIDsPart, err := m.userRpcClient.GetAllUserIDs(c, int32(pageNumber), int32(showNumber)) + ^ +internal/api/msg.go:312:5: return with no blank line before (nlreturn) + return + ^ +internal/api/msg.go:328:3: return with no blank line before (nlreturn) + return + ^ +internal/api/msg.go:335:4: continue with no blank line before (nlreturn) + continue + ^ +internal/api/route.go:46: Function 'NewGinRouter' has too many statements (137 > 50) (funlen) +func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.UniversalClient) *gin.Engine { +internal/api/route.go:216:2: return with no blank line before (nlreturn) + return r + ^ +internal/api/route.go:225:2: return with no blank line before (nlreturn) + return func(c *gin.Context) { + ^ +internal/api/route.go:233:5: return with no blank line before (nlreturn) + return + ^ +internal/api/route.go:240:5: return with no blank line before (nlreturn) + return + ^ +internal/api/route.go:247:5: return with no blank line before (nlreturn) + return + ^ +internal/api/route.go:253:5: return with no blank line before (nlreturn) + return + ^ +internal/api/route.go:262:6: return with no blank line before (nlreturn) + return + ^ +internal/api/route.go:267:6: return with no blank line before (nlreturn) + return + ^ +internal/api/route.go:272:5: return with no blank line before (nlreturn) + return + ^ +internal/api/third.go:76:3: return with no blank line before (nlreturn) + return + ^ +internal/api/third.go:97:4: return with no blank line before (nlreturn) + return + ^ +internal/api/third.go:101:4: return with no blank line before (nlreturn) + return + ^ +internal/api/third.go:104:3: return with no blank line before (nlreturn) + return + ^ +internal/api/user.go:71:3: return with no blank line before (nlreturn) + return + ^ +internal/api/user.go:76:3: return with no blank line before (nlreturn) + return + ^ +internal/api/user.go:80:2: Consider pre-allocating `respResult` (prealloc) + var respResult []*msggateway.GetUsersOnlineStatusResp_SuccessResult + ^ +internal/api/user.go:81:2: assigned to flag, but reassigned without using the value (wastedassign) + flag := false + ^ +internal/api/user.go:93:5: return with no blank line before (nlreturn) + return + ^ +internal/api/user.go:111:5: break with no blank line before (nlreturn) + break + ^ +internal/api/user.go:131:2: assigned to flag, but reassigned without using the value (wastedassign) + flag := false + ^ +internal/api/user.go:135:3: return with no blank line before (nlreturn) + return + ^ +internal/api/user.go:140:3: return with no blank line before (nlreturn) + return + ^ +internal/api/user.go:148:4: continue with no blank line before (nlreturn) + continue + ^ +internal/msggateway/callback.go:52:2: return with no blank line before (nlreturn) + return http.CallBackPostReturn(ctx, callBackURL(), &req, &resp, config.Config.Callback.CallbackUserOnline) + ^ +internal/msggateway/callback.go:73:2: return with no blank line before (nlreturn) + return http.CallBackPostReturn(ctx, callBackURL(), req, resp, config.Config.Callback.CallbackUserOffline) + ^ +internal/msggateway/callback.go:93:2: return with no blank line before (nlreturn) + return http.CallBackPostReturn(ctx, callBackURL(), req, resp, config.Config.Callback.CallbackUserOffline) + ^ +internal/msggateway/client.go:78:6: func `newClient` is unused (unused) +func newClient(ctx *UserConnContext, conn LongConn, isCompress bool) *Client { + ^ +internal/msggateway/client.go:111:24: Error return value of `c.conn.SetReadDeadline` is not checked (errcheck) + c.conn.SetReadDeadline(pongWait) + ^ +internal/msggateway/client.go:116:2: return with no blank line before (nlreturn) + return nil + ^ +internal/msggateway/client.go:135:4: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/client.go:138:6: S1002: should omit comparison to bool constant, can be simplified to `c.closed` (gosimple) + if c.closed == true { // 连接刚置位已经关闭,但是协程还没退出的场景 + ^ +internal/msggateway/client.go:140:4: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/client.go:148:5: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/client.go:152:4: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/client.go:158:4: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/client.go:211:2: return with no blank line before (nlreturn) + return nil + ^ +internal/msggateway/client.go:268:2: return with no blank line before (nlreturn) + return c.writeBinaryMsg(resp) + ^ +internal/msggateway/client.go:275:2: return with no blank line before (nlreturn) + return c.writeBinaryMsg(resp) + ^ +internal/msggateway/client.go:281:5: S1002: should omit comparison to bool constant, can be simplified to `c.closed` (gosimple) + if c.closed == true { + ^ +internal/msggateway/client.go:284:2: ineffectual assignment to encodedBuf (ineffassign) + encodedBuf := bufferPool.Get().([]byte) + ^ +internal/msggateway/client.go:285:2: ineffectual assignment to resultBuf (ineffassign) + resultBuf := bufferPool.Get().([]byte) + ^ +internal/msggateway/client.go:297:3: return with no blank line before (nlreturn) + return c.conn.WriteMessage(MessageBinary, resultBuf) + ^ +internal/msggateway/client.go:298:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + return c.conn.WriteMessage(MessageBinary, encodedBuf) + } +internal/msggateway/client.go:306:5: S1002: should omit comparison to bool constant, can be simplified to `c.closed` (gosimple) + if c.closed == true { + ^ +internal/msggateway/client.go:310:2: return with no blank line before (nlreturn) + return c.conn.WriteMessage(PongMessage, nil) + ^ +internal/msggateway/compressor.go:46:2: return with no blank line before (nlreturn) + return gzipBuffer.Bytes(), nil + ^ +internal/msggateway/compressor.go:60:2: return with no blank line before (nlreturn) + return compressedData, nil + ^ +internal/msggateway/context.go:91:2: return with no blank line before (nlreturn) + return value, true + ^ +internal/msggateway/context.go:99:2: return with no blank line before (nlreturn) + return value, true + ^ +internal/msggateway/context.go:106:37: param error has same name as predeclared identifier (predeclared) +func (c *UserConnContext) ErrReturn(error string, code int) { + ^ +internal/msggateway/context.go:127:2: SA4027: (*net/url.URL).Query returns a copy, modifying it doesn't change the URL (staticcheck) + c.Req.URL.Query().Set(OperationID, operationID) + ^ +internal/msggateway/context.go:142:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + return b + } +internal/msggateway/encoder.go:42:2: return with no blank line before (nlreturn) + return buff.Bytes(), nil + ^ +internal/msggateway/encoder.go:52:2: return with no blank line before (nlreturn) + return nil + ^ +internal/msggateway/hub_server.go:49:2: return with no blank line before (nlreturn) + return nil + ^ +internal/msggateway/hub_server.go:118:2: return with no blank line before (nlreturn) + return &resp, nil + ^ +internal/msggateway/hub_server.go:132:2: Consider pre-allocating `singleUserResult` (prealloc) + var singleUserResult []*msggateway.SingleMsgToUserResults + ^ +internal/msggateway/hub_server.go:143:4: continue with no blank line before (nlreturn) + continue + ^ +internal/msggateway/hub_server.go:147:4: `if client != nil` has complex nested blocks (complexity: 8) (nestif) + if client != nil { + ^ +internal/msggateway/hub_server.go:153:7: S1002: should omit comparison to bool constant, can be simplified to `client.IsBackground` (gosimple) + (client.IsBackground == true && client.PlatformID != constant.IOSPlatformID) { + ^ +internal/msggateway/hub_server.go:196:2: return with no blank line before (nlreturn) + return &msggateway.KickUserOfflineResp{}, nil + ^ +internal/msggateway/hub_server.go:218:2: return with no blank line before (nlreturn) + return &msggateway.MultiTerminalLoginCheckResp{}, nil + ^ +internal/msggateway/init.go:48:2: return with no blank line before (nlreturn) + return hubServer.LongConnServer.Run() + ^ +internal/msggateway/long_conn.go:73:2: return with no blank line before (nlreturn) + return nil + ^ +internal/msggateway/long_conn.go:102:2: return with no blank line before (nlreturn) + return httpResp, err + ^ +internal/msggateway/long_conn.go:106:2: S1008: should use 'return d.conn == nil' instead of 'if d.conn != nil { return false }; return true' (gosimple) + if d.conn != nil { + ^ +internal/msggateway/long_conn.go:109:2: return with no blank line before (nlreturn) + return true + ^ +internal/msggateway/message_handler.go:49:2: return with no blank line before (nlreturn) + return utils.StructToJsonString(tReq) + ^ +internal/msggateway/message_handler.go:68:2: return with no blank line before (nlreturn) + return utils.StructToJsonString(tResp) + ^ +internal/msggateway/message_handler.go:91:2: return with no blank line before (nlreturn) + return &GrpcHandler{ + ^ +internal/msggateway/message_handler.go:113:2: return with no blank line before (nlreturn) + return c, nil + ^ +internal/msggateway/message_handler.go:133:2: return with no blank line before (nlreturn) + return c, nil + ^ +internal/msggateway/message_handler.go:145:2: return with no blank line before (nlreturn) + return c, nil + ^ +internal/msggateway/message_handler.go:164:2: return with no blank line before (nlreturn) + return c, nil + ^ +internal/msggateway/message_handler.go:180:2: return with no blank line before (nlreturn) + return c, nil + ^ +internal/msggateway/message_handler.go:191:2: return with no blank line before (nlreturn) + return nil, req.IsBackground, nil + ^ +internal/msggateway/n_ws_server.go:80:2: field `hubServer` is unused (unused) + hubServer *Server + ^ +internal/msggateway/n_ws_server.go:150:2: return with no blank line before (nlreturn) + return &WsServer{ + ^ +internal/msggateway/n_ws_server.go:197:4: continue with no blank line before (nlreturn) + continue + ^ +internal/msggateway/n_ws_server.go:206:4: continue with no blank line before (nlreturn) + continue + ^ +internal/msggateway/n_ws_server.go:209:2: return with no blank line before (nlreturn) + return nil + ^ +internal/msggateway/n_ws_server.go:247:34: Error return value of `ws.sendUserOnlineInfoToOtherNode` is not checked (errcheck) + ws.sendUserOnlineInfoToOtherNode(client.ctx, client) + ^ +internal/msggateway/n_ws_server.go:268:2: return with no blank line before (nlreturn) + return ret + ^ +internal/msggateway/n_ws_server.go:273:2: return with no blank line before (nlreturn) + return client.KickOnlineMessage() + ^ +internal/msggateway/n_ws_server.go:276:1: cognitive complexity 32 of func `(*WsServer).multiTerminalLoginChecker` is high (> 30) (gocognit) +func (ws *WsServer) multiTerminalLoginChecker(clientOK bool, oldClients []*Client, newClient *Client) { +^ +internal/msggateway/n_ws_server.go:283:3: fallthrough with no blank line before (nlreturn) + fallthrough + ^ +internal/msggateway/n_ws_server.go:285:3: `if clientOK` has complex nested blocks (complexity: 6) (nestif) + if clientOK { + ^ +internal/msggateway/n_ws_server.go:301:21: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && err != redis.Nil { + ^ +internal/msggateway/n_ws_server.go:311:5: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:323:5: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:346:5: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:365: Function 'wsHandler' has too many statements (54 > 50) (funlen) +func (ws *WsServer) wsHandler(w http.ResponseWriter, r *http.Request) { +internal/msggateway/n_ws_server.go:369:3: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:382:3: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:387:3: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:392:3: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:397:3: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:399:5: shadow: declaration of "err" shadows declaration at line 394 (govet) + if err := authverify.WsVerifyToken(token, userID, platformID); err != nil { + ^ +internal/msggateway/n_ws_server.go:401:3: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:406:3: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:413:4: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:416:4: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:420:3: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/n_ws_server.go:426:3: return with no blank line before (nlreturn) + return + ^ +internal/msggateway/user_map.go:38:2: return with no blank line before (nlreturn) + return nil, ok + ^ +internal/msggateway/user_map.go:53:3: return with no blank line before (nlreturn) + return clients, userExisted, false + ^ +internal/msggateway/user_map.go:55:2: return with no blank line before (nlreturn) + return nil, userExisted, false + ^ +internal/msggateway/user_map.go:85:4: return with no blank line before (nlreturn) + return true + ^ +internal/msggateway/user_map.go:86:10: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + u.m.Store(key, a) + return false + } +internal/msggateway/user_map.go:88:4: return with no blank line before (nlreturn) + return false + ^ +internal/msggateway/user_map.go:91:2: return with no blank line before (nlreturn) + return existed + ^ +internal/msggateway/user_map.go:109:4: return with no blank line before (nlreturn) + return true + ^ +internal/msggateway/user_map.go:110:10: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + u.m.Store(key, a) + return false + } +internal/msggateway/user_map.go:112:4: return with no blank line before (nlreturn) + return false + ^ +internal/msggateway/user_map.go:115:2: return with no blank line before (nlreturn) + return existed + ^ +internal/msgtransfer/init.go:51:5: shadow: declaration of "err" shadows declaration at line 47 (govet) + if err := db.AutoMigrate(&relationtb.ChatLogModel{}); err != nil { + ^ +internal/msgtransfer/init.go:62:5: shadow: declaration of "err" shadows declaration at line 47 (govet) + if err := mongo.CreateMsgIndex(); err != nil { + ^ +internal/msgtransfer/init.go:84:2: return with no blank line before (nlreturn) + return msgTransfer.Start(prometheusPort) + ^ +internal/msgtransfer/init.go:125:2: return with no blank line before (nlreturn) + return nil + ^ +internal/msgtransfer/online_history_msg_handler.go:112:2: S1000: should use for range instead of for { select {} } (gosimple) + for { + ^ +internal/msgtransfer/online_history_msg_handler.go:174:1: cognitive complexity 32 of func `(*OnlineHistoryRedisConsumerHandler).getPushStorageMsgList` is high (> 30) (gocognit) +func (och *OnlineHistoryRedisConsumerHandler) getPushStorageMsgList( +^ +internal/msgtransfer/online_history_msg_handler.go:181:10: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + // if !(!options2.IsSenderSync() && conversationID == msg.MsgData.SendID) { + // return false + // } + return false + } +internal/msgtransfer/online_history_msg_handler.go:190:3: `if !options.IsNotNotification()` has complex nested blocks (complexity: 12) (nestif) + if !options.IsNotNotification() { + ^ +internal/msgtransfer/online_history_msg_handler.go:231:2: naked return in func `getPushStorageMsgList` with 58 lines of code (nakedret) + return + ^ +internal/msgtransfer/online_history_msg_handler.go:252:4: return with no blank line before (nlreturn) + return + ^ +internal/msgtransfer/online_history_msg_handler.go:255:31: Error return value of `och.msgDatabase.MsgToMongoMQ` is not checked (errcheck) + och.msgDatabase.MsgToMongoMQ(ctx, key, conversationID, storageList, lastSeq) + ^ +internal/msgtransfer/online_history_msg_handler.go:266:30: Error return value of `och.msgDatabase.MsgToPushMQ` is not checked (errcheck) + och.msgDatabase.MsgToPushMQ(ctx, key, conversationID, v) + ^ +internal/msgtransfer/online_history_msg_handler.go:276:2: `if len(storageList) > 0` has complex nested blocks (complexity: 16) (nestif) + if len(storageList) > 0 { + ^ +internal/msgtransfer/online_history_msg_handler.go:278:20: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +internal/msgtransfer/online_history_msg_handler.go:283:4: return with no blank line before (nlreturn) + return + ^ +internal/msgtransfer/online_history_msg_handler.go:307:31: Error return value of `och.msgDatabase.MsgToMongoMQ` is not checked (errcheck) + och.msgDatabase.MsgToMongoMQ(ctx, key, conversationID, storageList, lastSeq) + ^ +internal/msgtransfer/online_history_msg_handler.go:312:1: cognitive complexity 35 of func `(*OnlineHistoryRedisConsumerHandler).MessagesDistributionHandle` is high (> 30) (gocognit) +func (och *OnlineHistoryRedisConsumerHandler) MessagesDistributionHandle() { +^ +internal/msgtransfer/online_history_msg_handler.go:315:3: S1000: should use a simple channel send/receive instead of `select` with a single case (gosimple) + select { + ^ +internal/msgtransfer/online_history_msg_handler.go:330:7: continue with no blank line before (nlreturn) + continue + ^ +internal/msgtransfer/online_history_msg_handler.go:400:2: return with no blank line before (nlreturn) + return mcontext.SetOperationID(ctx, allMessageOperationID) + ^ +internal/msgtransfer/online_history_msg_handler.go:408:1: cognitive complexity 31 of func `(*OnlineHistoryRedisConsumerHandler).ConsumeClaim` is high (> 30) (gocognit) +func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim( +^ +internal/msgtransfer/online_history_msg_handler.go:426:3: S1000: should use for range instead of for { select {} } (gosimple) + for { + ^ +internal/msgtransfer/online_history_msg_handler.go:432:6: S1011: should replace loop with `ccMsg = append(ccMsg, cMsg...)` (gosimple) + for _, v := range cMsg { + ^ +internal/msgtransfer/online_history_msg_handler.go:464:2: return with no blank line before (nlreturn) + return nil + ^ +internal/msgtransfer/online_msg_to_mongo_handler.go:45:2: return with no blank line before (nlreturn) + return mc + ^ +internal/msgtransfer/online_msg_to_mongo_handler.go:52:2: `(*OnlineHistoryMongoConsumerHandler).handleChatWs2Mongo` - `session` is unused (unparam) + session sarama.ConsumerGroupSession, + ^ +internal/msgtransfer/online_msg_to_mongo_handler.go:59:3: return with no blank line before (nlreturn) + return + ^ +internal/msgtransfer/online_msg_to_mongo_handler.go:63:3: return with no blank line before (nlreturn) + return + ^ +internal/msgtransfer/online_msg_to_mongo_handler.go:78:2: Consider pre-allocating `seqs` (prealloc) + var seqs []int64 + ^ +internal/msgtransfer/online_msg_to_mongo_handler.go:115:2: return with no blank line before (nlreturn) + return nil + ^ +internal/msgtransfer/persistent_msg_handler.go:61:3: return with no blank line before (nlreturn) + return + ^ +internal/msgtransfer/persistent_msg_handler.go:68:2: `if isPersist` has complex nested blocks (complexity: 5) (nestif) + if isPersist { + ^ +internal/msgtransfer/persistent_msg_handler.go:85:5: return with no blank line before (nlreturn) + return + ^ +internal/msgtransfer/persistent_msg_handler.go:118:2: return with no blank line before (nlreturn) + return nil + ^ +internal/push/callback.go:65:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/push/callback.go:68:3: return with no blank line before (nlreturn) + return err + ^ +internal/push/callback.go:76:2: return with no blank line before (nlreturn) + return nil + ^ +internal/push/callback.go:102:2: return with no blank line before (nlreturn) + return http.CallBackPostReturn(ctx, url(), req, resp, config.Config.Callback.CallbackOnlinePush) + ^ +internal/push/callback.go:132:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/push/callback.go:135:3: return with no blank line before (nlreturn) + return err + ^ +internal/push/callback.go:140:2: return with no blank line before (nlreturn) + return nil + ^ +internal/push/consumer_init.go:23:2: field `successCount` is unused (unused) + successCount uint64 + ^ +internal/push/offlinepush/fcm/push.go:21:2: ST1019: package "github.com/openimsdk/open-im-server/v3/pkg/common/config" is being imported more than once (stylecheck) + config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" + ^ +internal/push/offlinepush/fcm/push.go:23:2: import of package `firebase.google.com/go` is blocked because the module is not in the allowed modules list. (gomodguard) + firebase "firebase.google.com/go" + ^ +internal/push/offlinepush/fcm/push.go:24:2: import of package `firebase.google.com/go/messaging` is blocked because the module is not in the allowed modules list. (gomodguard) + "firebase.google.com/go/messaging" + ^ +internal/push/offlinepush/fcm/push.go:31:2: ST1019(related information): other import of "github.com/openimsdk/open-im-server/v3/pkg/common/config" (stylecheck) + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + ^ +internal/push/offlinepush/fcm/push.go:59:3: unreachable: unreachable code (govet) + return nil + ^ +internal/push/offlinepush/fcm/push.go:61:2: return with no blank line before (nlreturn) + return &Fcm{fcmMsgCli: fcmMsgClient, cache: cache} + ^ +internal/push/offlinepush/fcm/push.go:64:1: cognitive complexity 32 of func `(*Fcm).Push` is high (> 30) (gocognit) +func (f *Fcm) Push(ctx context.Context, userIDs []string, title, content string, opts *offlinepush.Opts) error { +^ +internal/push/offlinepush/fcm/push.go:96:3: `if opts.IOSBadgeCount` has complex nested blocks (complexity: 6) (nestif) + if opts.IOSBadgeCount { + ^ +internal/push/offlinepush/fcm/push.go:103:5: continue with no blank line before (nlreturn) + continue + ^ +internal/push/offlinepush/fcm/push.go:109:14: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + } else if err == redis.Nil || unreadCountSum == 0 { + ^ +internal/push/offlinepush/fcm/push.go:115:5: continue with no blank line before (nlreturn) + continue + ^ +internal/push/offlinepush/fcm/push.go:132:4: ineffectual assignment to Fail (ineffassign) + Fail = Fail + messageCount + ^ +internal/push/offlinepush/fcm/push.go:135:4: ineffectual assignment to Success (ineffassign) + Success = Success + response.SuccessCount + ^ +internal/push/offlinepush/fcm/push.go:136:4: ineffectual assignment to Fail (ineffassign) + Fail = Fail + response.FailureCount + ^ +internal/push/offlinepush/fcm/push.go:139:2: return with no blank line before (nlreturn) + return nil + ^ +internal/push/offlinepush/getui/body.go:38:2: return with no blank line before (nlreturn) + return err + ^ +internal/push/offlinepush/getui/body.go:144:2: return with no blank line before (nlreturn) + return pushReq + ^ +internal/push/offlinepush/getui/body.go:149:2: return with no blank line before (nlreturn) + return PushReq{Audience: &Audience{Alias: userIDs}, IsAsync: &IsAsync, TaskID: &taskID} + ^ +internal/push/offlinepush/getui/push.go:70:2: `if err != nil` has complex nested blocks (complexity: 4) (nestif) + if err != nil { + ^ +internal/push/offlinepush/getui/push.go:71:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if errs.Unwrap(err) == redis.Nil { + ^ +internal/push/offlinepush/getui/push.go:83:2: `if len(userIDs) > 1` has complex nested blocks (complexity: 6) (nestif) + if len(userIDs) > 1 { + ^ +internal/push/offlinepush/getui/push.go:107:2: switch on an error will fail on wrapped errors. Use errors.Is to check for specific errors (errorlint) + switch err { + ^ +internal/push/offlinepush/getui/push.go:111:2: return with no blank line before (nlreturn) + return err + ^ +internal/push/offlinepush/getui/push.go:131:2: return with no blank line before (nlreturn) + return respAuth.Token, int64(expire), err + ^ +internal/push/offlinepush/getui/push.go:142:2: return with no blank line before (nlreturn) + return respTask.TaskID, nil + ^ +internal/push/offlinepush/getui/push.go:152:2: return with no blank line before (nlreturn) + return g.request(ctx, batchPushURL, pushReq, token, nil) + ^ +internal/push/offlinepush/getui/push.go:159:2: return with no blank line before (nlreturn) + return g.request(ctx, pushURL, pushReq, token, nil) + ^ +internal/push/offlinepush/getui/push.go:166:2: return with no blank line before (nlreturn) + return g.postReturn(ctx, config.Config.Push.GeTui.PushUrl+url, header, input, resp, 3) + ^ +internal/push/offlinepush/getui/push.go:181:2: return with no blank line before (nlreturn) + return output.parseError() + ^ +internal/push/offlinepush/getui/push.go:193:2: return with no blank line before (nlreturn) + return token, nil + ^ +internal/push/offlinepush/getui/push.go:206:2: return with no blank line before (nlreturn) + return token, nil + ^ +internal/push/offlinepush/jpush/push.go:46:2: return with no blank line before (nlreturn) + return Authorization + ^ +internal/push/offlinepush/jpush/push.go:73:2: return with no blank line before (nlreturn) + return j.request(ctx, pushObj, resp, 5) + ^ +internal/push/push_handler.go:46:2: return with no blank line before (nlreturn) + return &consumerHandler + ^ +internal/push/push_handler.go:53:3: return with no blank line before (nlreturn) + return + ^ +internal/push/push_handler.go:78:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errNoOfflinePusher { + ^ +internal/push/push_handler.go:95:2: return with no blank line before (nlreturn) + return nil + ^ +internal/push/push_rpc_server.go:74:2: return with no blank line before (nlreturn) + return nil + ^ +internal/push/push_rpc_server.go:85:6: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != errNoOfflinePusher { + ^ +internal/push/push_rpc_server.go:87:10: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + log.ZWarn(ctx, "offline push failed", err, "msg", pbData.String()) + } +internal/push/push_rpc_server.go:91:2: return with no blank line before (nlreturn) + return &pbpush.PushMsgResp{}, nil + ^ +internal/push/push_rpc_server.go:101:2: return with no blank line before (nlreturn) + return &pbpush.DelUserPushTokenResp{}, nil + ^ +internal/push/push_to_client.go:86:2: return with no blank line before (nlreturn) + return offlinePusher + ^ +internal/push/push_to_client.go:95:2: return with no blank line before (nlreturn) + return p.conversationRpcClient.SetConversationMaxSeq(ctx, userIDs, conevrsationID, maxSeq) + ^ +internal/push/push_to_client.go:112:2: `if isOfflinePush` has complex nested blocks (complexity: 5) (nestif) + if isOfflinePush { + ^ +internal/push/push_to_client.go:115:8: shadow: declaration of "err" shadows declaration at line 105 (govet) + if err := callbackOfflinePush(ctx, userIDs, msg, &[]string{}); err != nil { + ^ +internal/push/push_to_client.go:125:2: return with no blank line before (nlreturn) + return nil + ^ +internal/push/push_to_client.go:135:2: return with no blank line before (nlreturn) + return json.Unmarshal([]byte(notificationElem.Detail), t) + ^ +internal/push/push_to_client.go:138: Function 'Push2SuperGroup' has too many statements (81 > 50) (funlen) +func (p *Pusher) Push2SuperGroup(ctx context.Context, groupID string, msg *sdkws.MsgData) (err error) { +internal/push/push_to_client.go:141:5: shadow: declaration of "err" shadows declaration at line 138 (govet) + if err := callbackBeforeSuperGroupOnlinePush(ctx, groupID, msg, &pushToUserIDs); err != nil { + ^ +internal/push/push_to_client.go:144:2: `if len(pushToUserIDs) == 0` has complex nested blocks (complexity: 12) (nestif) + if len(pushToUserIDs) == 0 { + ^ +internal/push/push_to_client.go:156:8: shadow: declaration of "err" shadows declaration at line 138 (govet) + if err := p.DeleteMemberAndSetConversationSeq(ctx, groupID, userIDs); err != nil { + ^ +internal/push/push_to_client.go:168:8: shadow: declaration of "err" shadows declaration at line 138 (govet) + if err := p.DeleteMemberAndSetConversationSeq(ctx, groupID, userIDs); err != nil { + ^ +internal/push/push_to_client.go:184:9: shadow: declaration of "err" shadows declaration at line 138 (govet) + if err := p.groupRpcClient.DismissGroup(ctx, groupID); err != nil { + ^ +internal/push/push_to_client.go:198:2: `if isOfflinePush` has complex nested blocks (complexity: 29) (nestif) + if isOfflinePush { + ^ +internal/push/push_to_client.go:221:28: shadow: declaration of "err" shadows declaration at line 138 (govet) + notNotificationUserIDs, err := p.conversationLocalCache.GetRecvMsgNotNotifyUserIDs(ctx, groupID) + ^ +internal/push/push_to_client.go:249:6: return with no blank line before (nlreturn) + return err + ^ +internal/push/push_to_client.go:253:6: return with no blank line before (nlreturn) + return err + ^ +internal/push/push_to_client.go:258:2: return with no blank line before (nlreturn) + return nil + ^ +internal/push/push_to_client.go:279:2: return with no blank line before (nlreturn) + return wsResults, nil + ^ +internal/push/push_to_client.go:290:3: return with no blank line before (nlreturn) + return err + ^ +internal/push/push_to_client.go:293:2: return with no blank line before (nlreturn) + return nil + ^ +internal/push/push_to_client.go:313:2: return with no blank line before (nlreturn) + return opts, nil + ^ +internal/push/push_to_client.go:319:3: naked return in func `getOfflinePushInfos` with 48 lines of code (nakedret) + return + ^ +internal/push/push_to_client.go:328:3: naked return in func `getOfflinePushInfos` with 48 lines of code (nakedret) + return + ^ +internal/push/push_to_client.go:363:2: naked return in func `getOfflinePushInfos` with 48 lines of code (nakedret) + return + ^ +internal/push/tools.go:28:3: return with no blank line before (nlreturn) + return content + ^ +internal/push/tools.go:29:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + return string(msg.Content) + } +internal/rpc/auth/auth.go:61:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/auth/auth.go:78:2: return with no blank line before (nlreturn) + return &resp, nil + ^ +internal/rpc/auth/auth.go:103:2: return with no blank line before (nlreturn) + return nil, errs.ErrTokenNotExist.Wrap() + ^ +internal/rpc/auth/auth.go:118:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/auth/auth.go:128:2: return with no blank line before (nlreturn) + return &pbauth.ForceLogoutResp{}, nil + ^ +internal/rpc/auth/auth.go:131:89: `(*authServer).forceKickOff` - `operationID` is unused (unparam) +func (s *authServer) forceKickOff(ctx context.Context, userID string, platformID int32, operationID string) error { + ^ +internal/rpc/auth/auth.go:147:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/conversation/conversaion.go:52:5: shadow: declaration of "err" shadows declaration at line 48 (govet) + if err := db.AutoMigrate(&tablerelation.ConversationModel{}); err != nil { + ^ +internal/rpc/conversation/conversaion.go:67:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/conversation/conversaion.go:80:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/conversation/conversaion.go:90:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/conversation/conversaion.go:100:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/conversation/conversaion.go:114:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/conversation/conversaion.go:117: Function 'SetConversations' has too many statements (72 > 50) (funlen) +func (c *conversationServer) SetConversations(ctx context.Context, req *pbconversation.SetConversationsReq) (*pbconversation.SetConversationsResp, error) { +internal/rpc/conversation/conversaion.go:208:71: Error return value of `c.conversationNotificationSender.ConversationSetPrivateNotification` is not checked (errcheck) + c.conversationNotificationSender.ConversationSetPrivateNotification(ctx, userID, req.Conversation.UserID, req.Conversation.IsPrivateChat.Value, req.Conversation.ConversationID) + ^ +internal/rpc/conversation/conversaion.go:222:67: Error return value of `c.conversationNotificationSender.ConversationChangeNotification` is not checked (errcheck) + c.conversationNotificationSender.ConversationChangeNotification(ctx, v, []string{req.Conversation.ConversationID}) + ^ +internal/rpc/conversation/conversaion.go:225:2: return with no blank line before (nlreturn) + return &pbconversation.SetConversationsResp{}, nil + ^ +internal/rpc/conversation/conversaion.go:234:2: return with no blank line before (nlreturn) + return &pbconversation.GetRecvMsgNotNotifyUserIDsResp{UserIDs: userIDs}, nil + ^ +internal/rpc/conversation/conversaion.go:256:2: return with no blank line before (nlreturn) + return &pbconversation.CreateSingleChatConversationsResp{}, nil + ^ +internal/rpc/conversation/conversaion.go:264:2: return with no blank line before (nlreturn) + return &pbconversation.CreateGroupChatConversationsResp{}, nil + ^ +internal/rpc/conversation/conversaion.go:272:2: return with no blank line before (nlreturn) + return &pbconversation.SetConversationMaxSeqResp{}, nil + ^ +internal/rpc/conversation/conversaion.go:280:2: return with no blank line before (nlreturn) + return &pbconversation.GetConversationIDsResp{ConversationIDs: conversationIDs}, nil + ^ +internal/rpc/conversation/conversaion.go:288:2: return with no blank line before (nlreturn) + return &pbconversation.GetUserConversationIDsHashResp{Hash: hash}, nil + ^ +internal/rpc/conversation/conversaion.go:299:2: return with no blank line before (nlreturn) + return &pbconversation.GetConversationsByConversationIDResp{Conversations: convert.ConversationsDB2Pb(conversations)}, nil + ^ +internal/rpc/conversation/conversaion.go:326:2: return with no blank line before (nlreturn) + return &pbconversation.GetConversationOfflinePushUserIDsResp{UserIDs: utils.Keys(userIDSet)}, nil + ^ +internal/rpc/friend/black.go:34:5: shadow: declaration of "err" shadows declaration at line 33 (govet) + if err := s.userRpcClient.Access(ctx, req.UserID); err != nil { + ^ +internal/rpc/friend/black.go:52:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/black.go:63:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/black.go:77:2: return with no blank line before (nlreturn) + return &pbfriend.RemoveBlackResp{}, nil + ^ +internal/rpc/friend/black.go:97:45: Error return value of `s.notificationSender.BlackAddedNotification` is not checked (errcheck) + s.notificationSender.BlackAddedNotification(ctx, req) + ^ +internal/rpc/friend/black.go:98:2: return with no blank line before (nlreturn) + return &pbfriend.AddBlackResp{}, nil + ^ +internal/rpc/friend/callback.go:43:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/rpc/friend/callback.go:46:3: return with no blank line before (nlreturn) + return err + ^ +internal/rpc/friend/callback.go:48:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/friend/friend.go:59:5: shadow: declaration of "err" shadows declaration at line 55 (govet) + if err := db.AutoMigrate(&tablerelation.FriendModel{}, &tablerelation.FriendRequestModel{}, &tablerelation.BlackModel{}); err != nil { + ^ +internal/rpc/friend/friend.go:90:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/friend/friend.go:100:5: shadow: declaration of "err" shadows declaration at line 97 (govet) + if err := authverify.CheckAccessV3(ctx, req.FromUserID); err != nil { + ^ +internal/rpc/friend/friend.go:106:61: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err := CallbackBeforeAddFriend(ctx, req); err != nil && err != errs.ErrCallbackContinue { + ^ +internal/rpc/friend/friend.go:109:8: shadow: declaration of "err" shadows declaration at line 97 (govet) + if _, err := s.userRpcClient.GetUsersInfoMap(ctx, []string{req.ToUserID, req.FromUserID}); err != nil { + ^ +internal/rpc/friend/friend.go:122:55: Error return value of `s.notificationSender.FriendApplicationAddNotification` is not checked (errcheck) + s.notificationSender.FriendApplicationAddNotification(ctx, req) + ^ +internal/rpc/friend/friend.go:123:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:148:59: Error return value of `s.notificationSender.FriendApplicationAgreedNotification` is not checked (errcheck) + s.notificationSender.FriendApplicationAgreedNotification(ctx, &pbfriend.RespondFriendApplyReq{ + ^ +internal/rpc/friend/friend.go:154:2: return with no blank line before (nlreturn) + return &pbfriend.ImportFriendResp{}, nil + ^ +internal/rpc/friend/friend.go:179:59: Error return value of `s.notificationSender.FriendApplicationAgreedNotification` is not checked (errcheck) + s.notificationSender.FriendApplicationAgreedNotification(ctx, req) + ^ +internal/rpc/friend/friend.go:180:3: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:187:60: Error return value of `s.notificationSender.FriendApplicationRefusedNotification` is not checked (errcheck) + s.notificationSender.FriendApplicationRefusedNotification(ctx, req) + ^ +internal/rpc/friend/friend.go:188:3: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:190:2: return with no blank line before (nlreturn) + return nil, errs.ErrArgs.Wrap("req.HandleResult != -1/1") + ^ +internal/rpc/friend/friend.go:200:5: shadow: declaration of "err" shadows declaration at line 197 (govet) + if err := s.userRpcClient.Access(ctx, req.OwnerUserID); err != nil { + ^ +internal/rpc/friend/friend.go:210:48: Error return value of `s.notificationSender.FriendDeletedNotification` is not checked (errcheck) + s.notificationSender.FriendDeletedNotification(ctx, req) + ^ +internal/rpc/friend/friend.go:211:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:221:5: shadow: declaration of "err" shadows declaration at line 218 (govet) + if err := s.userRpcClient.Access(ctx, req.OwnerUserID); err != nil { + ^ +internal/rpc/friend/friend.go:231:50: Error return value of `s.notificationSender.FriendRemarkSetNotification` is not checked (errcheck) + s.notificationSender.FriendRemarkSetNotification(ctx, req.OwnerUserID, req.FriendUserID) + ^ +internal/rpc/friend/friend.go:232:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:252:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:265:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:274:5: shadow: declaration of "err" shadows declaration at line 272 (govet) + if err := s.userRpcClient.Access(ctx, req.UserID); err != nil { + ^ +internal/rpc/friend/friend.go:287:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:297:5: shadow: declaration of "err" shadows declaration at line 294 (govet) + if err := s.userRpcClient.Access(ctx, req.UserID); err != nil { + ^ +internal/rpc/friend/friend.go:309:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:323:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:331:5: shadow: declaration of "err" shadows declaration at line 329 (govet) + if err := s.userRpcClient.Access(ctx, req.UserID); err != nil { + ^ +internal/rpc/friend/friend.go:344:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:352:5: shadow: declaration of "err" shadows declaration at line 350 (govet) + if err := s.userRpcClient.Access(ctx, req.UserID); err != nil { + ^ +internal/rpc/friend/friend.go:360:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/friend/friend.go:423:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/cache.go:34:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/cache.go:46:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/callback.go:69:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/rpc/group/callback.go:72:3: return with no blank line before (nlreturn) + return err + ^ +internal/rpc/group/callback.go:86:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/group/callback.go:114:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/rpc/group/callback.go:117:3: return with no blank line before (nlreturn) + return err + ^ +internal/rpc/group/callback.go:126:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/group/callback.go:160:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/rpc/group/callback.go:163:3: return with no blank line before (nlreturn) + return err + ^ +internal/rpc/group/callback.go:177:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/group/db_map.go:55:2: return with no blank line before (nlreturn) + return m + ^ +internal/rpc/group/db_map.go:84:2: return with no blank line before (nlreturn) + return m + ^ +internal/rpc/group/fill.go:36:2: `if len(emptyUserIDs) > 0` has complex nested blocks (complexity: 4) (nestif) + if len(emptyUserIDs) > 0 { + ^ +internal/rpc/group/fill.go:54:2: return with no blank line before (nlreturn) + return members, nil + ^ +internal/rpc/group/fill.go:78:2: return with no blank line before (nlreturn) + return member, nil + ^ +internal/rpc/group/fill.go:98:2: return with no blank line before (nlreturn) + return owner, nil + ^ +internal/rpc/group/fill.go:116:2: `if len(emptyUserIDs) > 0` has complex nested blocks (complexity: 4) (nestif) + if len(emptyUserIDs) > 0 { + ^ +internal/rpc/group/fill.go:134:2: return with no blank line before (nlreturn) + return total, members, nil + ^ +internal/rpc/group/group.go:65:5: shadow: declaration of "err" shadows declaration at line 61 (govet) + if err := db.AutoMigrate(&relationtb.GroupModel{}, &relationtb.GroupMemberModel{}, &relationtb.GroupRequestModel{}); err != nil { + ^ +internal/rpc/group/group.go:88:3: return with no blank line before (nlreturn) + return utils.Slice(users, func(e *sdkws.UserInfo) notification.CommonUser { return e }), nil + ^ +internal/rpc/group/group.go:132:2: return with no blank line before (nlreturn) + return &pbgroup.NotificationUserInfoUpdateResp{}, nil + ^ +internal/rpc/group/group.go:145:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/group/group.go:156:2: return with no blank line before (nlreturn) + return utils.SliceToMapAny(users, func(e *sdkws.PublicUserInfo) (string, string) { + ^ +internal/rpc/group/group.go:186:4: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/group/group.go:191:2: return with no blank line before (nlreturn) + return errs.ErrData.Wrap("group id gen error") + ^ +internal/rpc/group/group.go:194:1: cognitive complexity 31 of func `(*groupServer).CreateGroup` is high (> 30) (gocognit) +func (s *groupServer) CreateGroup(ctx context.Context, req *pbgroup.CreateGroupReq) (*pbgroup.CreateGroupResp, error) { +^ +internal/rpc/group/group.go:242:3: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/group/group.go:247:2: `if req.GroupInfo.GroupType == constant.SuperGroup` has complex nested blocks (complexity: 4) (nestif) + if req.GroupInfo.GroupType == constant.SuperGroup { + ^ +internal/rpc/group/group.go:272:42: Error return value of `s.Notification.SuperGroupNotification` is not checked (errcheck) + s.Notification.SuperGroupNotification(ctx, userID, userID) + ^ +internal/rpc/group/group.go:287:5: break with no blank line before (nlreturn) + break + ^ +internal/rpc/group/group.go:290:42: Error return value of `s.Notification.GroupCreatedNotification` is not checked (errcheck) + s.Notification.GroupCreatedNotification(ctx, tips) + ^ +internal/rpc/group/group.go:292:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:339:3: return with no blank line before (nlreturn) + return convert.Db2PbGroupInfo(group, userID, groupMemberNum[group.GroupID]) + ^ +internal/rpc/group/group.go:341:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:344:1: cognitive complexity 43 of func `(*groupServer).InviteUserToGroup` is high (> 30) (gocognit) +func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbgroup.InviteUserToGroupReq) (*pbgroup.InviteUserToGroupResp, error) { +^ +internal/rpc/group/group.go:379:2: `if group.NeedVerification == constant.AllNeedVerification` has complex nested blocks (complexity: 6) (nestif) + if group.NeedVerification == constant.AllNeedVerification { + ^ +internal/rpc/group/group.go:397:53: Error return value of `s.Notification.JoinGroupApplicationNotification` is not checked (errcheck) + s.Notification.JoinGroupApplicationNotification(ctx, &pbgroup.JoinGroupReq{ + ^ +internal/rpc/group/group.go:404:5: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:409:2: `if group.GroupType == constant.SuperGroup` has complex nested blocks (complexity: 6) (nestif) + if group.GroupType == constant.SuperGroup { + ^ +internal/rpc/group/group.go:417:41: Error return value of `s.Notification.SuperGroupNotification` is not checked (errcheck) + s.Notification.SuperGroupNotification(ctx, userID, userID) + ^ +internal/rpc/group/group.go:444:43: Error return value of `s.Notification.MemberInvitedNotification` is not checked (errcheck) + s.Notification.MemberInvitedNotification(ctx, req.GroupID, req.Reason, req.InvitedUserIDs) + ^ +internal/rpc/group/group.go:446:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:472:3: return with no blank line before (nlreturn) + return convert.Db2PbGroupMember(e) + ^ +internal/rpc/group/group.go:474:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:487:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:490:1: cognitive complexity 36 of func `(*groupServer).KickGroupMember` is high (> 30) (gocognit) +func (s *groupServer) KickGroupMember(ctx context.Context, req *pbgroup.KickGroupMemberReq) (*pbgroup.KickGroupMemberResp, error) { +^ +internal/rpc/group/group.go:506:2: `if group.GroupType == constant.SuperGroup` has complex nested blocks (complexity: 14) (nestif) + if group.GroupType == constant.SuperGroup { + ^ +internal/rpc/group/group.go:512:42: Error return value of `s.Notification.SuperGroupNotification` is not checked (errcheck) + s.Notification.SuperGroupNotification(ctx, userID, userID) + ^ +internal/rpc/group/group.go:590:42: Error return value of `s.Notification.MemberKickedNotification` is not checked (errcheck) + s.Notification.MemberKickedNotification(ctx, tips) + ^ +internal/rpc/group/group.go:595:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:620:3: return with no blank line before (nlreturn) + return convert.Db2PbGroupMember(e) + ^ +internal/rpc/group/group.go:622:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:642:2: Consider pre-allocating `userIDs` (prealloc) + var userIDs []string + ^ +internal/rpc/group/group.go:676:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:704:3: return with no blank line before (nlreturn) + return convert.Db2PbGroupInfo(e, ownerUserID, groupMemberNumMap[e.GroupID]) + ^ +internal/rpc/group/group.go:706:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:735:8: shadow: declaration of "err" shadows declaration at line 723 (govet) + if _, err := s.GroupDatabase.TakeGroupMember(ctx, req.GroupID, req.FromUserID); err == nil { + ^ +internal/rpc/group/group.go:740:8: shadow: declaration of "err" shadows declaration at line 723 (govet) + if _, err := s.User.GetPublicUserInfo(ctx, req.FromUserID); err != nil { + ^ +internal/rpc/group/group.go:771:54: Error return value of `s.Notification.GroupApplicationAcceptedNotification` is not checked (errcheck) + s.Notification.GroupApplicationAcceptedNotification(ctx, req) + ^ +internal/rpc/group/group.go:775:42: Error return value of `s.Notification.MemberEnterNotification` is not checked (errcheck) + s.Notification.MemberEnterNotification(ctx, req.GroupID, req.FromUserID) + ^ +internal/rpc/group/group.go:778:54: Error return value of `s.Notification.GroupApplicationRejectedNotification` is not checked (errcheck) + s.Notification.GroupApplicationRejectedNotification(ctx, req) + ^ +internal/rpc/group/group.go:780:2: return with no blank line before (nlreturn) + return &pbgroup.GroupApplicationResponseResp{}, nil + ^ +internal/rpc/group/group.go:799:34: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + } else if !s.IsNotFound(err) && utils.Unwrap(err) != errs.ErrRecordNotFound { + ^ +internal/rpc/group/group.go:804:2: `if group.NeedVerification == constant.Directly` has complex nested blocks (complexity: 4) (nestif) + if group.NeedVerification == constant.Directly { + ^ +internal/rpc/group/group.go:826:41: Error return value of `s.Notification.MemberEnterNotification` is not checked (errcheck) + s.Notification.MemberEnterNotification(ctx, req.GroupID, req.InviterUserID) + ^ +internal/rpc/group/group.go:827:3: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:840:49: Error return value of `s.Notification.JoinGroupApplicationNotification` is not checked (errcheck) + s.Notification.JoinGroupApplicationNotification(ctx, req) + ^ +internal/rpc/group/group.go:841:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:850:2: `if group.GroupType == constant.SuperGroup` has complex nested blocks (complexity: 5) (nestif) + if group.GroupType == constant.SuperGroup { + ^ +internal/rpc/group/group.go:854:40: Error return value of `s.Notification.SuperGroupNotification` is not checked (errcheck) + s.Notification.SuperGroupNotification(ctx, mcontext.GetOpUserID(ctx), mcontext.GetOpUserID(ctx)) + ^ +internal/rpc/group/group.go:867:40: Error return value of `s.Notification.MemberQuitNotification` is not checked (errcheck) + s.Notification.MemberQuitNotification(ctx, s.groupMemberDB2PB(info, 0)) + ^ +internal/rpc/group/group.go:872:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:881:2: return with no blank line before (nlreturn) + return s.conversationRpcClient.SetConversationMaxSeq(ctx, userIDs, conevrsationID, maxSeq) + ^ +internal/rpc/group/group.go:884: Function 'SetGroupInfo' has too many statements (53 > 50) (funlen) +func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbgroup.SetGroupInfoReq) (*pbgroup.SetGroupInfoResp, error) { +internal/rpc/group/group.go:916:5: shadow: declaration of "err" shadows declaration at line 896 (govet) + if err := s.GroupDatabase.UpdateGroup(ctx, group.GroupID, data); err != nil { + ^ +internal/rpc/group/group.go:943:5: return with no blank line before (nlreturn) + return + ^ +internal/rpc/group/group.go:951:54: Error return value of `s.Notification.GroupInfoSetAnnouncementNotification` is not checked (errcheck) + s.Notification.GroupInfoSetAnnouncementNotification(ctx, &sdkws.GroupInfoSetAnnouncementTips{Group: tips.Group, OpUser: tips.OpUser}) + ^ +internal/rpc/group/group.go:957:43: Error return value of `s.Notification.GroupInfoSetNotification` is not checked (errcheck) + s.Notification.GroupInfoSetNotification(ctx, tips) + ^ +internal/rpc/group/group.go:959:47: Error return value of `s.Notification.GroupInfoSetNameNotification` is not checked (errcheck) + s.Notification.GroupInfoSetNameNotification(ctx, &sdkws.GroupInfoSetNameTips{Group: tips.Group, OpUser: tips.OpUser}) + ^ +internal/rpc/group/group.go:962:42: Error return value of `s.Notification.GroupInfoSetNotification` is not checked (errcheck) + s.Notification.GroupInfoSetNotification(ctx, tips) + ^ +internal/rpc/group/group.go:964:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1003:50: Error return value of `s.Notification.GroupOwnerTransferredNotification` is not checked (errcheck) + s.Notification.GroupOwnerTransferredNotification(ctx, req) + ^ +internal/rpc/group/group.go:1004:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1041:77: unnecessary conversion (unconvert) + return convert.Db2PbCMSGroup(group, member.UserID, member.Nickname, uint32(groupMemberNumMap[group.GroupID])) + ^ +internal/rpc/group/group.go:1043:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1063:3: return with no blank line before (nlreturn) + return convert.Db2PbGroupMember(e) + ^ +internal/rpc/group/group.go:1065:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1115:123: unnecessary conversion (unconvert) + return convert.Db2PbGroupRequest(e, user, convert.Db2PbGroupInfo(groupMap[e.GroupID], ownerMap[e.GroupID].UserID, uint32(groupMemberNum[e.GroupID]))) + ^ +internal/rpc/group/group.go:1117:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1136:5: S1002: should omit comparison to bool constant, can be simplified to `!req.DeleteMember` (gosimple) + if req.DeleteMember == false && group.Status == constant.GroupStatusDismissed { + ^ +internal/rpc/group/group.go:1145:2: `if group.GroupType == constant.SuperGroup` has complex nested blocks (complexity: 7) (nestif) + if group.GroupType == constant.SuperGroup { + ^ +internal/rpc/group/group.go:1163:45: Error return value of `s.Notification.GroupDismissedNotification` is not checked (errcheck) + s.Notification.GroupDismissedNotification(ctx, tips) + ^ +internal/rpc/group/group.go:1166:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1200:45: Error return value of `s.Notification.GroupMemberMutedNotification` is not checked (errcheck) + s.Notification.GroupMemberMutedNotification(ctx, req.GroupID, req.UserID, req.MutedSeconds) + ^ +internal/rpc/group/group.go:1201:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1248:51: Error return value of `s.Notification.GroupMemberCancelMutedNotification` is not checked (errcheck) + s.Notification.GroupMemberCancelMutedNotification(ctx, req.GroupID, req.UserID) + ^ +internal/rpc/group/group.go:1249:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1260:39: Error return value of `s.Notification.GroupMutedNotification` is not checked (errcheck) + s.Notification.GroupMutedNotification(ctx, req.GroupID) + ^ +internal/rpc/group/group.go:1261:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1272:45: Error return value of `s.Notification.GroupCancelMutedNotification` is not checked (errcheck) + s.Notification.GroupCancelMutedNotification(ctx, req.GroupID) + ^ +internal/rpc/group/group.go:1273:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1276: Function 'SetGroupMemberInfo' has too many statements (76 > 50) (funlen) +func (s *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbgroup.SetGroupMemberInfoReq) (*pbgroup.SetGroupMemberInfoResp, error) { +internal/rpc/group/group.go:1313:2: `if !authverify.IsAppManagerUid(ctx)` has complex nested blocks (complexity: 9) (nestif) + if !authverify.IsAppManagerUid(ctx) { + ^ +internal/rpc/group/group.go:1331:5: continue with no blank line before (nlreturn) + continue + ^ +internal/rpc/group/group.go:1375:6: shadow: declaration of "err" shadows declaration at line 1298 (govet) + if err := CallbackBeforeSetGroupMemberInfo(ctx, req.Members[i]); err != nil { + ^ +internal/rpc/group/group.go:1392:53: Error return value of `s.Notification.GroupMemberSetToAdminNotification` is not checked (errcheck) + s.Notification.GroupMemberSetToAdminNotification(ctx, member.GroupID, member.UserID) + ^ +internal/rpc/group/group.go:1394:60: Error return value of `s.Notification.GroupMemberSetToOrdinaryUserNotification` is not checked (errcheck) + s.Notification.GroupMemberSetToOrdinaryUserNotification(ctx, member.GroupID, member.UserID) + ^ +internal/rpc/group/group.go:1404:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1433:3: return with no blank line before (nlreturn) + return convert.Db2PbGroupAbstractInfo(group.GroupID, users.MemberNum, users.Hash) + ^ +internal/rpc/group/group.go:1435:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1457:3: return with no blank line before (nlreturn) + return convert.Db2PbGroupMember(e) + ^ +internal/rpc/group/group.go:1459:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1468:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1490:3: return with no blank line before (nlreturn) + return convert.Db2PbGroupMember(e) + ^ +internal/rpc/group/group.go:1492:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1532:122: unnecessary conversion (unconvert) + return convert.Db2PbGroupRequest(e, nil, convert.Db2PbGroupInfo(groupMap[e.GroupID], ownerMap[e.GroupID].UserID, uint32(groupMemberNum[e.GroupID]))) + ^ +internal/rpc/group/group.go:1535:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/group.go:1545:9: shadow: declaration of "err" shadows declaration at line 1539 (govet) + resp, err := s.GetGroupMembersInfo(ctx, &pbgroup.GetGroupMembersInfoReq{GroupID: groupID, UserIDs: userIDs}) + ^ +internal/rpc/group/group.go:1568:9: G401: Use of weak cryptographic primitive (gosec) + sum := md5.Sum(data) + ^ +internal/rpc/group/group.go:1569:2: return with no blank line before (nlreturn) + return binary.BigEndian.Uint64(sum[:]), nil + ^ +internal/rpc/group/statistics.go:42:2: return with no blank line before (nlreturn) + return &group.GroupCreateCountResp{Total: total, Before: before, Count: count}, nil + ^ +internal/rpc/group/super_group.go:78:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/group/super_group.go:113:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/msg/as_read.go:67:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/msg/as_read.go:81:5: shadow: declaration of "err" shadows declaration at line 73 (govet) + if err := m.MsgDatabase.SetHasReadSeq(ctx, req.UserID, req.ConversationID, req.HasReadSeq); err != nil { + ^ +internal/rpc/msg/as_read.go:87:2: return with no blank line before (nlreturn) + return &msg.SetConversationHasReadSeqResp{}, nil + ^ +internal/rpc/msg/as_read.go:99:3: naked return in func `MarkMsgsAsRead` with 36 lines of code (nakedret) + return + ^ +internal/rpc/msg/as_read.go:107:3: naked return in func `MarkMsgsAsRead` with 36 lines of code (nakedret) + return + ^ +internal/rpc/msg/as_read.go:110:3: naked return in func `MarkMsgsAsRead` with 36 lines of code (nakedret) + return + ^ +internal/rpc/msg/as_read.go:113:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +internal/rpc/msg/as_read.go:114:3: naked return in func `MarkMsgsAsRead` with 36 lines of code (nakedret) + return + ^ +internal/rpc/msg/as_read.go:119:4: naked return in func `MarkMsgsAsRead` with 36 lines of code (nakedret) + return + ^ +internal/rpc/msg/as_read.go:123:3: naked return in func `MarkMsgsAsRead` with 36 lines of code (nakedret) + return + ^ +internal/rpc/msg/as_read.go:125:2: return with no blank line before (nlreturn) + return &msg.MarkMsgsAsReadResp{}, nil + ^ +internal/rpc/msg/as_read.go:134:3: naked return in func `MarkConversationAsRead` with 38 lines of code (nakedret) + return + ^ +internal/rpc/msg/as_read.go:137:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +internal/rpc/msg/as_read.go:138:3: naked return in func `MarkConversationAsRead` with 38 lines of code (nakedret) + return + ^ +internal/rpc/msg/as_read.go:152:4: naked return in func `MarkConversationAsRead` with 38 lines of code (nakedret) + return + ^ +internal/rpc/msg/as_read.go:158:4: naked return in func `MarkConversationAsRead` with 38 lines of code (nakedret) + return + ^ +internal/rpc/msg/as_read.go:163:3: naked return in func `MarkConversationAsRead` with 38 lines of code (nakedret) + return + ^ +internal/rpc/msg/as_read.go:165:2: return with no blank line before (nlreturn) + return &msg.MarkConversationAsReadResp{}, nil + ^ +internal/rpc/msg/as_read.go:175:3: (*msgServer).sendMarkAsReadNotification - result 0 (error) is always nil (unparam) +) error { + ^ +internal/rpc/msg/as_read.go:182:51: Error return value of `m.notificationSender.NotificationWithSesstionType` is not checked (errcheck) + m.notificationSender.NotificationWithSesstionType(ctx, sendID, recvID, constant.HasReadReceipt, sesstionType, tips) + ^ +internal/rpc/msg/as_read.go:183:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/callback.go:66:3: return with no blank line before (nlreturn) + return content + ^ +internal/rpc/msg/callback.go:67:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + return string(msg.Content) + } +internal/rpc/msg/callback.go:82:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/rpc/msg/callback.go:85:3: return with no blank line before (nlreturn) + return err + ^ +internal/rpc/msg/callback.go:87:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/callback.go:100:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/rpc/msg/callback.go:103:3: return with no blank line before (nlreturn) + return err + ^ +internal/rpc/msg/callback.go:105:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/callback.go:118:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/rpc/msg/callback.go:121:3: return with no blank line before (nlreturn) + return err + ^ +internal/rpc/msg/callback.go:123:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/callback.go:136:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/rpc/msg/callback.go:139:3: return with no blank line before (nlreturn) + return err + ^ +internal/rpc/msg/callback.go:141:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/callback.go:153:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/rpc/msg/callback.go:156:3: return with no blank line before (nlreturn) + return err + ^ +internal/rpc/msg/callback.go:178:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/delete.go:35:2: return with no blank line before (nlreturn) + return minSeqs + ^ +internal/rpc/msg/delete.go:42:2: return with no blank line before (nlreturn) + return opt.IsSyncSelf, opt.IsSyncOther + ^ +internal/rpc/msg/delete.go:55:2: return with no blank line before (nlreturn) + return &msg.ClearConversationsMsgResp{}, nil + ^ +internal/rpc/msg/delete.go:73:2: return with no blank line before (nlreturn) + return &msg.UserClearAllMsgResp{}, nil + ^ +internal/rpc/msg/delete.go:81:2: `if isSyncOther` has complex nested blocks (complexity: 5) (nestif) + if isSyncOther { + ^ +internal/rpc/msg/delete.go:90:52: Error return value of `m.notificationSender.NotificationWithSesstionType` is not checked (errcheck) + m.notificationSender.NotificationWithSesstionType( + ^ +internal/rpc/msg/delete.go:104:53: Error return value of `m.notificationSender.NotificationWithSesstionType` is not checked (errcheck) + m.notificationSender.NotificationWithSesstionType(ctx, req.UserID, req.UserID, constant.DeleteMsgsNotification, constant.SingleChatType, tips) + ^ +internal/rpc/msg/delete.go:107:2: return with no blank line before (nlreturn) + return &msg.DeleteMsgsResp{}, nil + ^ +internal/rpc/msg/delete.go:118:2: return with no blank line before (nlreturn) + return &msg.DeleteMsgPhysicalBySeqResp{}, nil + ^ +internal/rpc/msg/delete.go:142:2: return with no blank line before (nlreturn) + return &msg.DeleteMsgPhysicalResp{}, nil + ^ +internal/rpc/msg/delete.go:156:2: Consider pre-allocating `existConversations` (prealloc) + var existConversations []*conversation.Conversation + ^ +internal/rpc/msg/delete.go:157:2: Consider pre-allocating `existConversationIDs` (prealloc) + var existConversationIDs []string + ^ +internal/rpc/msg/delete.go:168:2: `if !isSyncOther` has complex nested blocks (complexity: 4) (nestif) + if !isSyncOther { + ^ +internal/rpc/msg/delete.go:175:53: Error return value of `m.notificationSender.NotificationWithSesstionType` is not checked (errcheck) + m.notificationSender.NotificationWithSesstionType( + ^ +internal/rpc/msg/delete.go:190:53: Error return value of `m.notificationSender.NotificationWithSesstionType` is not checked (errcheck) + m.notificationSender.NotificationWithSesstionType(ctx, userID, m.conversationAndGetRecvID(conversation, userID), constant.ClearConversationNotification, conversation.ConversationType, tips) + ^ +internal/rpc/msg/delete.go:196:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/message_interceptor.go:35:10: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + return nil, errs.ErrMessageHasReadDisable.Wrap() + } +internal/rpc/msg/message_interceptor.go:41:10: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + return nil, errs.ErrMessageHasReadDisable.Wrap() + } +internal/rpc/msg/message_interceptor.go:45:2: return with no blank line before (nlreturn) + return req.MsgData, nil + ^ +internal/rpc/msg/msg_status.go:33:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/msg/msg_status.go:44:3: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/msg/msg_status.go:49:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/msg/revoke.go:36: Function 'RevokeMsg' has too many statements (56 > 50) (funlen) +func (m *msgServer) RevokeMsg(ctx context.Context, req *msg.RevokeMsgReq) (*msg.RevokeMsgResp, error) { +internal/rpc/msg/revoke.go:64:13: Error return value of `encoding/json.Marshal` is not checked (errchkjson) + data, _ := json.Marshal(msgs[0]) + ^ +internal/rpc/msg/revoke.go:67:2: `if !authverify.IsAppManagerUid(ctx)` has complex nested blocks (complexity: 6) (nestif) + if !authverify.IsAppManagerUid(ctx) { + ^ +internal/rpc/msg/revoke.go:70:7: shadow: declaration of "err" shadows declaration at line 50 (govet) + if err := authverify.CheckAccessV3(ctx, msgs[0].SendID); err != nil { + ^ +internal/rpc/msg/revoke.go:75:13: shadow: declaration of "err" shadows declaration at line 50 (govet) + members, err := m.Group.GetGroupMemberInfoMap( + ^ +internal/rpc/msg/revoke.go:131:2: return with no blank line before (nlreturn) + return &msg.RevokeMsgResp{}, nil + ^ +internal/rpc/msg/send.go:35:99: named return error has same name as predeclared identifier (predeclared) +func (m *msgServer) SendMsg(ctx context.Context, req *pbmsg.SendMsgReq) (resp *pbmsg.SendMsgResp, error error) { + ^ +internal/rpc/msg/send.go:36:2: ineffectual assignment to resp (ineffassign) + resp = &pbmsg.SendMsgResp{} + ^ +internal/rpc/msg/send.go:65:3: return with no blank line before (nlreturn) + return nil, err + ^ +internal/rpc/msg/send.go:70:5: shadow: declaration of "err" shadows declaration at line 61 (govet) + if err := callbackMsgModify(ctx, req); err != nil { + ^ +internal/rpc/msg/send.go:88:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/msg/send.go:101:2: `if tagAll` has complex nested blocks (complexity: 8) (nestif) + if tagAll { + ^ +internal/rpc/msg/send.go:105:4: return with no blank line before (nlreturn) + return + ^ +internal/rpc/msg/send.go:112:4: shadow: declaration of "err" shadows declaration at line 102 (govet) + err := m.Conversation.SetConversations(ctx, atUserID, conversation) + ^ +internal/rpc/msg/send.go:139:3: return with no blank line before (nlreturn) + return nil, err + ^ +internal/rpc/msg/send.go:146:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/msg/send.go:151:5: shadow: declaration of "err" shadows declaration at line 149 (govet) + if err := m.messageVerification(ctx, req); err != nil { + ^ +internal/rpc/msg/send.go:168:2: `if !isSend` has complex nested blocks (complexity: 5) (nestif) + if !isSend { + ^ +internal/rpc/msg/send.go:170:3: return with no blank line before (nlreturn) + return nil, nil + ^ +internal/rpc/msg/send.go:171:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + if err = callbackBeforeSendSingleMsg(ctx, req); err != nil { + return nil, err + } + if err := callbackMsgModify(ctx, req); err != nil { + return nil, err + } + if err := m.MsgDatabase.MsgToMQ(ctx, utils.GenConversationUniqueKeyForSingle(req.MsgData.SendID, req.MsgData.RecvID), req.MsgData); err != nil { + promepkg.Inc(promepkg.SingleChatMsgProcessFailedCounter) + return nil, err + } + err = callbackAfterSendSingleMsg(ctx, req) + if err != nil { + log.ZWarn(ctx, "CallbackAfterSendSingleMsg", err, "req", req) + } + resp = &pbmsg.SendMsgResp{ + ServerMsgID: req.MsgData.ServerMsgID, + ClientMsgID: req.MsgData.ClientMsgID, + SendTime: req.MsgData.SendTime, + } + promepkg.Inc(promepkg.SingleChatMsgProcessSuccessCounter) + return resp, nil + } +internal/rpc/msg/send.go:175:6: shadow: declaration of "err" shadows declaration at line 149 (govet) + if err := callbackMsgModify(ctx, req); err != nil { + ^ +internal/rpc/msg/send.go:178:6: shadow: declaration of "err" shadows declaration at line 149 (govet) + if err := m.MsgDatabase.MsgToMQ(ctx, utils.GenConversationUniqueKeyForSingle(req.MsgData.SendID, req.MsgData.RecvID), req.MsgData); err != nil { + ^ +internal/rpc/msg/send.go:180:4: return with no blank line before (nlreturn) + return nil, err + ^ +internal/rpc/msg/send.go:192:3: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/msg/seq.go:31:2: return with no blank line before (nlreturn) + return &pbmsg.GetConversationMaxSeqResp{MaxSeq: maxSeq}, nil + ^ +internal/rpc/msg/server.go:55:21: func `(*msgServer).execInterceptorHandler` is unused (unused) +func (m *msgServer) execInterceptorHandler(ctx context.Context, req *msg.SendMsgReq) error { + ^ +internal/rpc/msg/server.go:63:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/server.go:99:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/server.go:129:2: return with no blank line before (nlreturn) + return + ^ +internal/rpc/msg/statistics.go:63:2: return with no blank line before (nlreturn) + return &msg.GetActiveUserResp{ + ^ +internal/rpc/msg/statistics.go:109:2: return with no blank line before (nlreturn) + return &msg.GetActiveGroupResp{ + ^ +internal/rpc/msg/sync_msg.go:39:3: `if !msgprocessor.IsNotification(seq.ConversationID)` has complex nested blocks (complexity: 4) (nestif) + if !msgprocessor.IsNotification(seq.ConversationID) { + ^ +internal/rpc/msg/sync_msg.go:43:5: continue with no blank line before (nlreturn) + continue + ^ +internal/rpc/msg/sync_msg.go:56:5: continue with no blank line before (nlreturn) + continue + ^ +internal/rpc/msg/sync_msg.go:74:5: continue with no blank line before (nlreturn) + continue + ^ +internal/rpc/msg/sync_msg.go:86:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/msg/sync_msg.go:105:3: return with no blank line before (nlreturn) + return nil, err + ^ +internal/rpc/msg/sync_msg.go:109:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/msg/sync_msg.go:112: Function 'SearchMessage' has too many statements (52 > 50) (funlen) +func (m *msgServer) SearchMessage(ctx context.Context, req *msg.SearchMessageReq) (resp *msg.SearchMessageResp, err error) { +internal/rpc/msg/sync_msg.go:168:25: Error return value of `utils.CopyStructFields` is not checked (errcheck) + utils.CopyStructFields(pbchatLog, chatLog) + ^ +internal/rpc/msg/sync_msg.go:189:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/msg/utils.go:33:10: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + return false + } +internal/rpc/msg/utils.go:39:10: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + return false + } +internal/rpc/msg/utils.go:43:2: return with no blank line before (nlreturn) + return true + ^ +internal/rpc/msg/utils.go:47:2: switch on an error will fail on wrapped errors. Use errors.Is to check for specific errors (errorlint) + switch utils.Unwrap(err) { + ^ +internal/rpc/msg/verify.go:51:1: cognitive complexity 43 of func `(*msgServer).messageVerification` is high (> 30) (gocognit) +func (m *msgServer) messageVerification(ctx context.Context, data *msg.SendMsgReq) error { +^ +internal/rpc/msg/verify.go:76:4: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/verify.go:78:3: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/verify.go:108:7: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrRecordNotFound { + ^ +internal/rpc/msg/verify.go:111:4: return with no blank line before (nlreturn) + return err + ^ +internal/rpc/msg/verify.go:115:10: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + if groupMemberInfo.MuteEndTime >= time.Now().UnixMilli() { + return errs.ErrMutedInGroup.Wrap() + } + if groupInfo.Status == constant.GroupStatusMuted && groupMemberInfo.RoleLevel != constant.GroupAdmin { + return errs.ErrMutedGroup.Wrap() + } + } +internal/rpc/msg/verify.go:123:3: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/msg/verify.go:180:2: return with no blank line before (nlreturn) + return utils.Md5(t + "-" + sendID + "-" + strconv.Itoa(rand.Int())) + ^ +internal/rpc/msg/verify.go:186:2: `(*msgServer).modifyMessageByUserMessageReceiveOpt` - `sessionType` is unused (unparam) + sessionType int, + ^ +internal/rpc/msg/verify.go:202:3: return with no blank line before (nlreturn) + return true, nil + ^ +internal/rpc/msg/verify.go:218:3: return with no blank line before (nlreturn) + return false, nil + ^ +internal/rpc/msg/verify.go:224:3: return with no blank line before (nlreturn) + return true, nil + ^ +internal/rpc/msg/verify.go:226:2: return with no blank line before (nlreturn) + return true, nil + ^ +internal/rpc/third/log.go:22:11: Error return value of `rand.Read` is not checked (errcheck) + rand.Read(data) + ^ +internal/rpc/third/log.go:31:2: return with no blank line before (nlreturn) + return string(data) + ^ +internal/rpc/third/log.go:35:2: Consider pre-allocating `DBlogs` (prealloc) + var DBlogs []*relationtb.Log + ^ +internal/rpc/third/log.go:56:5: break with no blank line before (nlreturn) + break + ^ +internal/rpc/third/log.go:68:2: return with no blank line before (nlreturn) + return &third.UploadLogsResp{}, nil + ^ +internal/rpc/third/log.go:80:2: Consider pre-allocating `logIDs` (prealloc) + var logIDs []string + ^ +internal/rpc/third/log.go:109:2: return with no blank line before (nlreturn) + return utils.Slice(logs, db2pbForLogInfo) + ^ +internal/rpc/third/log.go:116:2: Consider pre-allocating `userIDs` (prealloc) + var ( + ^ +internal/rpc/third/log.go:144:2: return with no blank line before (nlreturn) + return &resp, nil + ^ +internal/rpc/third/s3.go:36:2: return with no blank line before (nlreturn) + return &third.PartLimitResp{ + ^ +internal/rpc/third/s3.go:48:2: return with no blank line before (nlreturn) + return &third.PartSizeResp{Size: size}, nil + ^ +internal/rpc/third/s3.go:59:19: type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint) + if haErr, ok := errs.Unwrap(err).(*cont.HashAlreadyExistsError); ok { + ^ +internal/rpc/third/s3.go:70:7: shadow: declaration of "err" shadows declaration at line 57 (govet) + if err := t.s3dataBase.SetObject(ctx, obj); err != nil { + ^ +internal/rpc/third/s3.go:73:4: return with no blank line before (nlreturn) + return &third.InitiateMultipartUploadResp{ + ^ +internal/rpc/third/s3.go:77:3: return with no blank line before (nlreturn) + return nil, err + ^ +internal/rpc/third/s3.go:96:2: return with no blank line before (nlreturn) + return &third.InitiateMultipartUploadResp{ + ^ +internal/rpc/third/s3.go:127:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/third/s3.go:152:2: return with no blank line before (nlreturn) + return &third.CompleteMultipartUploadResp{ + ^ +internal/rpc/third/s3.go:176:2: return with no blank line before (nlreturn) + return &third.AccessURLResp{ + ^ +internal/rpc/third/third.go:62:5: shadow: declaration of "err" shadows declaration at line 54 (govet) + if err := db.AutoMigrate(&relationtb.ObjectModel{}); err != nil { + ^ +internal/rpc/third/third.go:88:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/third/third.go:104:2: return with no blank line before (nlreturn) + return &third.FcmUpdateTokenResp{}, nil + ^ +internal/rpc/third/third.go:112:2: return with no blank line before (nlreturn) + return &third.SetAppBadgeResp{}, nil + ^ +internal/rpc/third/tool.go:39:2: return with no blank line before (nlreturn) + return res + ^ +internal/rpc/third/tool.go:61:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/third/tool.go:71:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/third/tool.go:78:2: return with no blank line before (nlreturn) + return checkValidObjectNamePrefix(objectName) + ^ +internal/rpc/user/callback.go:44:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == errs.ErrCallbackContinue { + ^ +internal/rpc/user/callback.go:47:3: return with no blank line before (nlreturn) + return err + ^ +internal/rpc/user/callback.go:52:2: return with no blank line before (nlreturn) + return nil + ^ +internal/rpc/user/statistics.go:45:2: return with no blank line before (nlreturn) + return &pbuser.UserRegisterCountResp{Total: total, Before: before, Count: count}, nil + ^ +internal/rpc/user/user.go:96:2: return with no blank line before (nlreturn) + return u.UserDatabase.InitOnce(context.Background(), users) + ^ +internal/rpc/user/user.go:109:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/user/user.go:118:5: shadow: declaration of "err" shadows declaration at line 112 (govet) + if err := CallbackBeforeUpdateUserInfo(ctx, req); err != nil { + ^ +internal/rpc/user/user.go:145:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/user/user.go:158:56: Error return value of `s.friendNotificationSender.UserInfoUpdatedNotification` is not checked (errcheck) + s.friendNotificationSender.UserInfoUpdatedNotification(ctx, req.UserID) + ^ +internal/rpc/user/user.go:159:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/user/user.go:188:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/user/user.go:201:2: return with no blank line before (nlreturn) + return &pbuser.GetPaginationUsersResp{Total: int32(total), Users: convert.UsersDB2Pb(users)}, err + ^ +internal/rpc/user/user.go:211:3: return with no blank line before (nlreturn) + return nil, errs.ErrNoPermission.Wrap("secret invalid") + ^ +internal/rpc/user/user.go:249:2: return with no blank line before (nlreturn) + return resp, nil + ^ +internal/rpc/user/user.go:257:2: return with no blank line before (nlreturn) + return &pbuser.GetGlobalRecvMessageOptResp{GlobalRecvMsgOpt: user[0].GlobalRecvMsgOpt}, nil + ^ +internal/rpc/user/user.go:266:2: return with no blank line before (nlreturn) + return &pbuser.GetAllUserIDResp{UserIDs: userIDs}, nil + ^ +internal/rpc/user/user.go:271:2: `if req.Genre == constant.SubscriberUser` has complex nested blocks (complexity: 4) (nestif) + if req.Genre == constant.SubscriberUser { + ^ +internal/rpc/user/user.go:281:3: return with no blank line before (nlreturn) + return &pbuser.SubscribeOrCancelUsersStatusResp{StatusList: status}, nil + ^ +internal/rpc/user/user.go:288:2: return with no blank line before (nlreturn) + return &pbuser.SubscribeOrCancelUsersStatusResp{}, nil + ^ +internal/rpc/user/user.go:297:2: return with no blank line before (nlreturn) + return &pbuser.GetUserStatusResp{StatusList: onlineStatusList}, nil + ^ +internal/rpc/user/user.go:318:57: Error return value of `s.userNotificationSender.UserStatusChangeNotification` is not checked (errcheck) + s.userNotificationSender.UserStatusChangeNotification(ctx, tips) + ^ +internal/rpc/user/user.go:321:2: return with no blank line before (nlreturn) + return &pbuser.SetUserStatusResp{}, nil + ^ +internal/rpc/user/user.go:334:2: return with no blank line before (nlreturn) + return &pbuser.GetSubscribeUsersStatusResp{StatusList: onlineStatusList}, nil + ^ +internal/tools/conversation.go:32:3: return with no blank line before (nlreturn) + return + ^ +internal/tools/conversation.go:53:4: continue with no blank line before (nlreturn) + continue + ^ +internal/tools/conversation.go:58:5: continue with no blank line before (nlreturn) + continue + ^ +internal/tools/cron_task.go:53:2: return with no blank line before (nlreturn) + return nil + ^ +internal/tools/msg.go:102:2: return with no blank line before (nlreturn) + return msgTool, nil + ^ +internal/tools/msg.go:111:3: return with no blank line before (nlreturn) + return + ^ +internal/tools/msg.go:139:2: return with no blank line before (nlreturn) + return nil + ^ +internal/tools/msg.go:145:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if errs.Unwrap(err) == redis.Nil { + ^ +internal/tools/msg.go:148:3: return with no blank line before (nlreturn) + return err + ^ +internal/tools/msg.go:153:2: return with no blank line before (nlreturn) + return nil + ^ +internal/tools/msg.go:160:3: return with no blank line before (nlreturn) + return err + ^ +internal/tools/msg.go:171:2: return with no blank line before (nlreturn) + return nil + ^ +internal/tools/msg_doc_convert.go:30:3: return with no blank line before (nlreturn) + return + ^ +internal/tools/msg_doc_convert.go:38:3: return with no blank line before (nlreturn) + return + ^ +pkg/authverify/token.go:44:2: return with no blank line before (nlreturn) + return errs.ErrNoPermission.Wrap(utils.GetSelfFuncName()) + ^ +pkg/authverify/token.go:55:2: return with no blank line before (nlreturn) + return errs.ErrNoPermission.Wrap(fmt.Sprintf("user %s is not admin userID", mcontext.GetOpUserID(ctx))) + ^ +pkg/authverify/token.go:77:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/callbackstruct/common.go:64:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/cmd/cron_task.go:35:2: return with no blank line before (nlreturn) + return c.Execute() + ^ +pkg/common/cmd/msg_gateway.go:39:2: return with no blank line before (nlreturn) + return port + ^ +pkg/common/cmd/msg_gateway.go:50:2: return with no blank line before (nlreturn) + return m.Execute() + ^ +pkg/common/cmd/msg_transfer.go:39:2: return with no blank line before (nlreturn) + return m.Execute() + ^ +pkg/common/cmd/msg_utils.go:25:2: field `msgTool` is unused (unused) + msgTool *tools.MsgTool + ^ +pkg/common/cmd/msg_utils.go:34:2: return with no blank line before (nlreturn) + return userID + ^ +pkg/common/cmd/msg_utils.go:41:23: func `(*MsgUtilsCmd).getFixAllFlag` is unused (unused) +func (m *MsgUtilsCmd) getFixAllFlag(cmdLines *cobra.Command) bool { + ^ +pkg/common/cmd/msg_utils.go:43:2: return with no blank line before (nlreturn) + return fixAll + ^ +pkg/common/cmd/msg_utils.go:50:23: func `(*MsgUtilsCmd).getClearAllFlag` is unused (unused) +func (m *MsgUtilsCmd) getClearAllFlag(cmdLines *cobra.Command) bool { + ^ +pkg/common/cmd/msg_utils.go:52:2: return with no blank line before (nlreturn) + return clearAll + ^ +pkg/common/cmd/msg_utils.go:61:2: return with no blank line before (nlreturn) + return superGroupID + ^ +pkg/common/cmd/msg_utils.go:68:23: func `(*MsgUtilsCmd).getBeginSeqFlag` is unused (unused) +func (m *MsgUtilsCmd) getBeginSeqFlag(cmdLines *cobra.Command) int64 { + ^ +pkg/common/cmd/msg_utils.go:70:2: return with no blank line before (nlreturn) + return beginSeq + ^ +pkg/common/cmd/msg_utils.go:77:23: func `(*MsgUtilsCmd).getLimitFlag` is unused (unused) +func (m *MsgUtilsCmd) getLimitFlag(cmdLines *cobra.Command) int64 { + ^ +pkg/common/cmd/msg_utils.go:79:2: return with no blank line before (nlreturn) + return limit + ^ +pkg/common/cmd/msg_utils.go:134:2: return with no blank line before (nlreturn) + return seqCmd + ^ +pkg/common/cmd/msg_utils.go:161:2: return with no blank line before (nlreturn) + return &s.Command + ^ +pkg/common/cmd/msg_utils.go:176:2: return with no blank line before (nlreturn) + return msgCmd + ^ +pkg/common/cmd/root.go:20:2: ST1019: package "github.com/openimsdk/open-im-server/v3/pkg/common/config" is being imported more than once (stylecheck) + config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" + ^ +pkg/common/cmd/root.go:26:2: ST1019(related information): other import of "github.com/openimsdk/open-im-server/v3/pkg/common/config" (stylecheck) + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + ^ +pkg/common/cmd/root.go:69: line is 280 characters (lll) + if err := log.InitFromConfig(cmdOpts.loggerPrefixName, name, config.Config.Log.RemainLogLevel, config.Config.Log.IsStdout, config.Config.Log.IsJson, config.Config.Log.StorageLocation, config.Config.Log.RemainRotationCount, config.Config.Log.RotationTime); err != nil { +pkg/common/cmd/root.go:72:4: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/cmd/root.go:77:2: return with no blank line before (nlreturn) + return rootCmd + ^ +pkg/common/cmd/root.go:90:2: return with no blank line before (nlreturn) + return port + ^ +pkg/common/cmd/root.go:103:2: return with no blank line before (nlreturn) + return port + ^ +pkg/common/cmd/root.go:113:2: return with no blank line before (nlreturn) + return config2.InitConfig(configFolderPath) + ^ +pkg/common/cmd/rpc.go:34:2: return with no blank line before (nlreturn) + return authCmd + ^ +pkg/common/cmd/rpc.go:42:2: return with no blank line before (nlreturn) + return a.Execute() + ^ +pkg/common/cmd/rpc.go:52:2: return with no blank line before (nlreturn) + return startrpc.Start(a.GetPortFlag(), name, a.GetPrometheusPortFlag(), rpcFn) + ^ +pkg/common/config/config.go:334:2: return with no blank line before (nlreturn) + return registry.RegisterConf2Registry(ConfKey, data) + ^ +pkg/common/config/config.go:346:2: return with no blank line before (nlreturn) + return buf.Bytes() + ^ +pkg/common/config/parse.go:60:2: return with no blank line before (nlreturn) + return opts + ^ +pkg/common/config/parse.go:87:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/config/parse.go:99:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/convert/black.go:20:2: ST1019: package "github.com/OpenIMSDK/protocol/sdkws" is being imported more than once (stylecheck) + "github.com/OpenIMSDK/protocol/sdkws" + ^ +pkg/common/convert/black.go:21:2: ST1019(related information): other import of "github.com/OpenIMSDK/protocol/sdkws" (stylecheck) + sdk "github.com/OpenIMSDK/protocol/sdkws" + ^ +pkg/common/convert/black.go:34:2: Consider pre-allocating `userIDs` (prealloc) + var userIDs []string + ^ +pkg/common/convert/black.go:58:2: return with no blank line before (nlreturn) + return blackPbs, nil + ^ +pkg/common/convert/conversation.go:30:2: return with no blank line before (nlreturn) + return conversationPB + ^ +pkg/common/convert/conversation.go:42:2: return with no blank line before (nlreturn) + return conversationsPB + ^ +pkg/common/convert/conversation.go:50:2: return with no blank line before (nlreturn) + return conversationDB + ^ +pkg/common/convert/conversation.go:61:2: return with no blank line before (nlreturn) + return conversationsDB + ^ +pkg/common/convert/friend.go:28:24: Error return value of `utils.CopyStructFields` is not checked (errcheck) + utils.CopyStructFields(dbFriend, friend) + ^ +pkg/common/convert/friend.go:31:2: return with no blank line before (nlreturn) + return dbFriend + ^ +pkg/common/convert/friend.go:40:24: Error return value of `utils.CopyStructFields` is not checked (errcheck) + utils.CopyStructFields(pbfriend, friendDB) + ^ +pkg/common/convert/friend.go:50:2: return with no blank line before (nlreturn) + return pbfriend, nil + ^ +pkg/common/convert/friend.go:61:2: Consider pre-allocating `userID` (prealloc) + var userID []string + ^ +pkg/common/convert/friend.go:71:25: Error return value of `utils.CopyStructFields` is not checked (errcheck) + utils.CopyStructFields(friendPb, friend) + ^ +pkg/common/convert/friend.go:79:2: return with no blank line before (nlreturn) + return friendsPb, nil + ^ +pkg/common/convert/friend.go:119:2: return with no blank line before (nlreturn) + return res, nil + ^ +pkg/common/convert/msg.go:58:2: return with no blank line before (nlreturn) + return &msgDataModel + ^ +pkg/common/convert/msg.go:98:2: return with no blank line before (nlreturn) + return &msg + ^ +pkg/common/convert/user.go:37:2: return with no blank line before (nlreturn) + return result + ^ +pkg/common/convert/user.go:49:2: return with no blank line before (nlreturn) + return &userDB + ^ +pkg/common/db/cache/black.go:55:2: return with no blank line before (nlreturn) + return &BlackCacheRedis{ + ^ +pkg/common/db/cache/black.go:91:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/conversation.go:92:2: return with no blank line before (nlreturn) + return &ConversationRedisCache{ + ^ +pkg/common/db/cache/conversation.go:113:2: return with no blank line before (nlreturn) + return &ConversationRedisCache{ + ^ +pkg/common/db/cache/conversation.go:171:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/conversation.go:177:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/conversation.go:201:4: return with no blank line before (nlreturn) + return bi.Uint64(), nil + ^ +pkg/common/db/cache/conversation.go:207:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/conversation.go:213:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/conversation.go:232:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/conversation.go:238:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/conversation.go:251:2: return with no blank line before (nlreturn) + return 0, errors.New("not found key:" + key + " in keys") + ^ +pkg/common/db/cache/conversation.go:259:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/conversation.go:263:2: return with no blank line before (nlreturn) + return batchGetCache( + ^ +pkg/common/db/cache/conversation.go:283:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/conversation.go:287:2: return with no blank line before (nlreturn) + return batchGetCache( + ^ +pkg/common/db/cache/conversation.go:330:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/conversation.go:336:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/conversation.go:342:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/conversation.go:348:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/conversation.go:368:4: return with no blank line before (nlreturn) + return bi.Uint64(), nil + ^ +pkg/common/db/cache/conversation.go:376:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/conversation.go:388:2: return with no blank line before (nlreturn) + return 0, errors.New("not found key:" + conversationID + " in keys") + ^ +pkg/common/db/cache/conversation.go:399:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/conversation.go:403:2: return with no blank line before (nlreturn) + return batchGetCacheMap( + ^ +pkg/common/db/cache/conversation.go:423:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/conversation.go:454:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/friend.go:62:2: return with no blank line before (nlreturn) + return &FriendCacheRedis{ + ^ +pkg/common/db/cache/friend.go:104:2: variable new has same name as predeclared identifier (predeclared) + new := f.NewCache() + ^ +pkg/common/db/cache/friend.go:105:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/friend.go:110:2: return with no blank line before (nlreturn) + return new + ^ +pkg/common/db/cache/friend.go:131:2: return with no blank line before (nlreturn) + return twoWayFriendIDs, nil + ^ +pkg/common/db/cache/friend.go:135:2: variable new has same name as predeclared identifier (predeclared) + new := f.NewCache() + ^ +pkg/common/db/cache/friend.go:137:2: return with no blank line before (nlreturn) + return new + ^ +pkg/common/db/cache/friend.go:156:2: variable new has same name as predeclared identifier (predeclared) + new := f.NewCache() + ^ +pkg/common/db/cache/friend.go:158:2: return with no blank line before (nlreturn) + return new + ^ +pkg/common/db/cache/group.go:112:2: return with no blank line before (nlreturn) + return &GroupCacheRedis{ + ^ +pkg/common/db/cache/group.go:172:2: return with no blank line before (nlreturn) + return 0, errIndex + ^ +pkg/common/db/cache/group.go:182:2: return with no blank line before (nlreturn) + return 0, errIndex + ^ +pkg/common/db/cache/group.go:190:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/group.go:194:2: return with no blank line before (nlreturn) + return batchGetCache( + ^ +pkg/common/db/cache/group.go:219:2: variable new has same name as predeclared identifier (predeclared) + new := g.NewCache() + ^ +pkg/common/db/cache/group.go:220:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/group.go:225:2: return with no blank line before (nlreturn) + return new + ^ +pkg/common/db/cache/group.go:242:4: return with no blank line before (nlreturn) + return userGroup.GroupIDs, nil + ^ +pkg/common/db/cache/group.go:251:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/group.go:255:2: return with no blank line before (nlreturn) + return batchGetCache( + ^ +pkg/common/db/cache/group.go:266:4: return with no blank line before (nlreturn) + return 0, errIndex + ^ +pkg/common/db/cache/group.go:276:2: variable new has same name as predeclared identifier (predeclared) + new := g.NewCache() + ^ +pkg/common/db/cache/group.go:277:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/group.go:282:2: return with no blank line before (nlreturn) + return new + ^ +pkg/common/db/cache/group.go:286:2: variable new has same name as predeclared identifier (predeclared) + new := g.NewCache() + ^ +pkg/common/db/cache/group.go:287:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/group.go:292:2: return with no blank line before (nlreturn) + return new + ^ +pkg/common/db/cache/group.go:371:2: return with no blank line before (nlreturn) + return res, nil + ^ +pkg/common/db/cache/group.go:377:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/group.go:402:2: return with no blank line before (nlreturn) + return m, nil + ^ +pkg/common/db/cache/group.go:408:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/group.go:424:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/group.go:430:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/group.go:453:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/group.go:457:2: return with no blank line before (nlreturn) + return batchGetCache( + ^ +pkg/common/db/cache/group.go:485:2: return with no blank line before (nlreturn) + return uint32(len(userIDs)), groupMembers, err + ^ +pkg/common/db/cache/group.go:496:2: return with no blank line before (nlreturn) + return g.GetGroupMembersInfo(ctx, groupID, groupMemberIDs) + ^ +pkg/common/db/cache/group.go:507:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/group.go:511:2: return with no blank line before (nlreturn) + return batchGetCache( + ^ +pkg/common/db/cache/group.go:524:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/group.go:530:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/group.go:546:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/group.go:552:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/init_redis.go:61:6: ineffectual assignment to err (ineffassign) + var err error = nil + ^ +pkg/common/db/cache/init_redis.go:68:2: return with no blank line before (nlreturn) + return rdb, err + ^ +pkg/common/db/cache/meta_cache.go:60:2: `if len(m.keys) > 0` has complex nested blocks (complexity: 4) (nestif) + if len(m.keys) > 0 { + ^ +pkg/common/db/cache/meta_cache.go:75:6: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/cache/meta_cache.go:83:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/cache/meta_cache.go:106:2: return with no blank line before (nlreturn) + return opts + ^ +pkg/common/db/cache/meta_cache.go:128:3: return with no blank line before (nlreturn) + return string(bs), nil + ^ +pkg/common/db/cache/meta_cache.go:142:3: return with no blank line before (nlreturn) + return t, utils.Wrap(err, "") + ^ +pkg/common/db/cache/meta_cache.go:144:2: return with no blank line before (nlreturn) + return t, nil + ^ +pkg/common/db/cache/meta_cache.go:172:3: return with no blank line before (nlreturn) + return values, nil + ^ +pkg/common/db/cache/meta_cache.go:188:2: return with no blank line before (nlreturn) + return tArrays, nil + ^ +pkg/common/db/cache/meta_cache.go:216:3: return with no blank line before (nlreturn) + return values, nil + ^ +pkg/common/db/cache/meta_cache.go:232:2: return with no blank line before (nlreturn) + return tMap, nil + ^ +pkg/common/db/cache/msg.go:144:2: field `expireTime` is unused (unused) + expireTime time.Duration + ^ +pkg/common/db/cache/msg.go:145:2: field `rcClient` is unused (unused) + rcClient *rockscache.Client + ^ +pkg/common/db/cache/msg.go:146:2: field `msgDocDatabase` is unused (unused) + msgDocDatabase unrelationtb.MsgDocModelInterface + ^ +pkg/common/db/cache/msg.go:185:59: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err := pipe.Get(ctx, getkey(v)).Err(); err != nil && err != redis.Nil { + ^ +pkg/common/db/cache/msg.go:190:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && err != redis.Nil { + ^ +pkg/common/db/cache/msg.go:196:26: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if seq.Err() != nil && seq.Err() != redis.Nil { + ^ +pkg/common/db/cache/msg.go:204:2: return with no blank line before (nlreturn) + return m, nil + ^ +pkg/common/db/cache/msg.go:232:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/cache/msg.go:322:2: return with no blank line before (nlreturn) + return errs.Wrap(c.rdb.HSet(ctx, key, token, flag).Err()) + ^ +pkg/common/db/cache/msg.go:335:2: return with no blank line before (nlreturn) + return mm, nil + ^ +pkg/common/db/cache/msg.go:344:2: return with no blank line before (nlreturn) + return errs.Wrap(c.rdb.HSet(ctx, key, mm).Err()) + ^ +pkg/common/db/cache/msg.go:349:2: return with no blank line before (nlreturn) + return errs.Wrap(c.rdb.HDel(ctx, key, fields...).Err()) + ^ +pkg/common/db/cache/msg.go:369:53: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err := pipe.Get(ctx, key).Err(); err != nil && err != redis.Nil { + ^ +pkg/common/db/cache/msg.go:376:3: `if cmd.Err() != nil` has complex nested blocks (complexity: 5) (nestif) + if cmd.Err() != nil { + ^ +pkg/common/db/cache/msg.go:384:6: continue with no blank line before (nlreturn) + continue + ^ +pkg/common/db/cache/msg.go:392:2: return with no blank line before (nlreturn) + return seqMsgs, failedSeqs, err + ^ +pkg/common/db/cache/msg.go:411:2: return with no blank line before (nlreturn) + return len(failedMsgs), err + ^ +pkg/common/db/cache/msg.go:443:2: return with no blank line before (nlreturn) + return errs.Wrap(err) + ^ +pkg/common/db/cache/msg.go:455:2: return with no blank line before (nlreturn) + return seqs, nil + ^ +pkg/common/db/cache/msg.go:463:4: continue with no blank line before (nlreturn) + continue + ^ +pkg/common/db/cache/msg.go:465:3: `if len(delUsers) > 0` has complex nested blocks (complexity: 5) (nestif) + if len(delUsers) > 0 { + ^ +pkg/common/db/cache/msg.go:505:2: return with no blank line before (nlreturn) + return errs.Wrap(err) + ^ +pkg/common/db/cache/msg.go:510:5: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == redis.Nil { + ^ +pkg/common/db/cache/msg.go:518:6: shadow: declaration of "err" shadows declaration at line 509 (govet) + if err := pipe.Del(ctx, v).Err(); err != nil { + ^ +pkg/common/db/cache/msg.go:523:2: return with no blank line before (nlreturn) + return errs.Wrap(err) + ^ +pkg/common/db/cache/msg.go:531:7: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == redis.Nil { + ^ +pkg/common/db/cache/msg.go:534:4: return with no blank line before (nlreturn) + return errs.Wrap(err) + ^ +pkg/common/db/cache/msg.go:537:6: shadow: declaration of "err" shadows declaration at line 529 (govet) + if err := jsonpb.UnmarshalString(result, &msg); err != nil { + ^ +pkg/common/db/cache/msg.go:549:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/cache/msg.go:574:2: return with no blank line before (nlreturn) + return int32(result), errs.Wrap(err) + ^ +pkg/common/db/cache/msg.go:600:2: return with no blank line before (nlreturn) + return int(seq), errs.Wrap(err) + ^ +pkg/common/db/cache/msg.go:613:2: return with no blank line before (nlreturn) + return errs.Wrap(c.rdb.SetNX(ctx, key, 1, time.Minute).Err()) + ^ +pkg/common/db/cache/msg.go:618:2: return with no blank line before (nlreturn) + return errs.Wrap(c.rdb.Del(ctx, key).Err()) + ^ +pkg/common/db/cache/msg.go:632:2: return with no blank line before (nlreturn) + return "" + ^ +pkg/common/db/cache/msg.go:640:2: return with no blank line before (nlreturn) + return n > 0, nil + ^ +pkg/common/db/cache/user.go:71:2: return with no blank line before (nlreturn) + return &UserCacheRedis{ + ^ +pkg/common/db/cache/user.go:98:26: func `(*UserCacheRedis).getUserStatusHashKey` is unused (unused) +func (u *UserCacheRedis) getUserStatusHashKey(userID string, Id int32) string { + ^ +pkg/common/db/cache/user.go:115:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/user.go:119:2: return with no blank line before (nlreturn) + return batchGetCache( + ^ +pkg/common/db/cache/user.go:130:4: return with no blank line before (nlreturn) + return 0, errIndex + ^ +pkg/common/db/cache/user.go:139:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/user.go:145:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/user.go:161:2: Consider pre-allocating `keys` (prealloc) + var keys []string + ^ +pkg/common/db/cache/user.go:167:2: return with no blank line before (nlreturn) + return cache + ^ +pkg/common/db/cache/user.go:170:26: func `(*UserCacheRedis).getOnlineStatusKey` is unused (unused) +func (u *UserCacheRedis) getOnlineStatusKey(userID string) string { + ^ +pkg/common/db/cache/user.go:176:2: Consider pre-allocating `res` (prealloc) + var res []*user.OnlineStatus + ^ +pkg/common/db/cache/user.go:184:7: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == redis.Nil { + ^ +pkg/common/db/cache/user.go:191:5: continue with no blank line before (nlreturn) + continue + ^ +pkg/common/db/cache/user.go:203:2: return with no blank line before (nlreturn) + return res, nil + ^ +pkg/common/db/cache/user.go:207:1: cognitive complexity 54 of func `(*UserCacheRedis).SetUserStatus` is high (> 30) (gocognit) +func (u *UserCacheRedis) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error { +^ +pkg/common/db/cache/user.go:221:3: `if isNewKey == 0` has complex nested blocks (complexity: 31) (nestif) + if isNewKey == 0 { + ^ +pkg/common/db/cache/user.go:274:7: break with no blank line before (nlreturn) + break + ^ +pkg/common/db/cache/user.go:291:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/auth.go:72:3: shadow: declaration of "err" shadows declaration at line 60 (govet) + err := a.cache.DeleteTokenByUidPid(ctx, userID, platformID, deleteTokenKey) + ^ +pkg/common/db/controller/auth.go:83:2: return with no blank line before (nlreturn) + return tokenString, a.cache.AddTokenFlag(ctx, userID, platformID, tokenString, constant.NormalToken) + ^ +pkg/common/db/controller/black.go:58:2: return with no blank line before (nlreturn) + return b.deleteBlackIDsCache(ctx, blacks) + ^ +pkg/common/db/controller/black.go:66:2: return with no blank line before (nlreturn) + return b.deleteBlackIDsCache(ctx, blacks) + ^ +pkg/common/db/controller/black.go:74:2: return with no blank line before (nlreturn) + return cache.ExecDel(ctx) + ^ +pkg/common/db/controller/black.go:100:2: return with no blank line before (nlreturn) + return utils.IsContain(userID2, userID1BlackIDs), utils.IsContain(userID1, userID2BlackIDs), nil + ^ +pkg/common/db/controller/conversation.go:102:7: shadow: declaration of "err" shadows declaration at line 77 (govet) + if err := utils.CopyStructFields(temp, conversation); err != nil { + ^ +pkg/common/db/controller/conversation.go:116:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/conversation.go:120:2: return with no blank line before (nlreturn) + return cache.ExecDel(ctx) + ^ +pkg/common/db/controller/conversation.go:133:2: return with no blank line before (nlreturn) + return cache.ExecDel(ctx) + ^ +pkg/common/db/controller/conversation.go:140:2: Consider pre-allocating `userIDs` (prealloc) + var userIDs []string + ^ +pkg/common/db/controller/conversation.go:147:2: return with no blank line before (nlreturn) + return cache.DelConversationIDs(userIDs...).DelUserConversationIDsHash(userIDs...).ExecDel(ctx) + ^ +pkg/common/db/controller/conversation.go:181:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/conversation.go:185:2: return with no blank line before (nlreturn) + return cache.ExecDel(ctx) + ^ +pkg/common/db/controller/conversation.go:237: line is 250 characters (lll) + cache = cache.DelConversationIDs(ownerUserID).DelUserConversationIDsHash(ownerUserID).DelConversationNotReceiveMessageUserIDs(utils.Slice(notExistConversations, func(e *relationtb.ConversationModel) string { return e.ConversationID })...) +pkg/common/db/controller/conversation.go:239:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/conversation.go:243:2: return with no blank line before (nlreturn) + return cache.ExecDel(ctx) + ^ +pkg/common/db/controller/conversation.go:279:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/conversation.go:283:2: return with no blank line before (nlreturn) + return cache.ExecDel(ctx) + ^ +pkg/common/db/controller/friend.go:112:2: return with no blank line before (nlreturn) + return utils.IsContain(userID2, userID1FriendIDs), utils.IsContain(userID1, userID2FriendIDs), nil + ^ +pkg/common/db/controller/friend.go:125:20: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != gorm.ErrRecordNotFound { + ^ +pkg/common/db/controller/friend.go:139:4: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/friend.go:145:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/friend.go:193:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/friend.go:195:3: error is not nil (line 157) but it returns nil (nilerr) + return nil + ^ +pkg/common/db/controller/friend.go:197:2: return with no blank line before (nlreturn) + return cache.ExecDel(ctx) + ^ +pkg/common/db/controller/friend.go:219:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/friend.go:254:27: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + } else if err != nil && errs.Unwrap(err) != gorm.ErrRecordNotFound { + ^ +pkg/common/db/controller/friend.go:293:3: return with no blank line before (nlreturn) + return f.cache.DelFriendIDs(friendRequest.ToUserID, friendRequest.FromUserID).ExecDel(ctx) + ^ +pkg/common/db/controller/friend.go:302:2: return with no blank line before (nlreturn) + return f.cache.DelFriendIDs(append(friendUserIDs, ownerUserID)...).ExecDel(ctx) + ^ +pkg/common/db/controller/friend.go:310:2: return with no blank line before (nlreturn) + return f.cache.DelFriend(ownerUserID, friendUserID).ExecDel(ctx) + ^ +pkg/common/db/controller/friend.go:362:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/controller/group.go:104:2: return with no blank line before (nlreturn) + return database + ^ +pkg/common/db/controller/group.go:111:2: return with no blank line before (nlreturn) + return NewGroupDatabase( + ^ +pkg/common/db/controller/group.go:153:2: return with no blank line before (nlreturn) + return uint32(num), nil + ^ +pkg/common/db/controller/group.go:186:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/group.go:190:2: return with no blank line before (nlreturn) + return cache.ExecDel(ctx) + ^ +pkg/common/db/controller/group.go:213:2: return with no blank line before (nlreturn) + return g.cache.DelGroupsInfo(groupID).ExecDel(ctx) + ^ +pkg/common/db/controller/group.go:233:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/group.go:237:2: return with no blank line before (nlreturn) + return cache.ExecDel(ctx) + ^ +pkg/common/db/controller/group.go:278:3: return with no blank line before (nlreturn) + return res, nil + ^ +pkg/common/db/controller/group.go:288:3: return with no blank line before (nlreturn) + return totalGroupMembers, nil + ^ +pkg/common/db/controller/group.go:290:2: return with no blank line before (nlreturn) + return g.groupMemberDB.Find(ctx, groupIDs, userIDs, roleLevels) + ^ +pkg/common/db/controller/group.go:309:2: return with no blank line before (nlreturn) + return uint32(len(groupIDs)), totalGroupMembers, nil + ^ +pkg/common/db/controller/group.go:329:2: return with no blank line before (nlreturn) + return uint32(len(groupMemberIDs)), members, nil + ^ +pkg/common/db/controller/group.go:380:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/group.go:388:2: return with no blank line before (nlreturn) + return g.cache.DelGroupMembersHash(groupID). + ^ +pkg/common/db/controller/group.go:412:2: return with no blank line before (nlreturn) + return m, nil + ^ +pkg/common/db/controller/group.go:431:3: return with no blank line before (nlreturn) + return g.cache.DelGroupMembersInfo(groupID, oldOwnerUserID, newOwnerUserID).DelGroupMembersHash(groupID).ExecDel(ctx) + ^ +pkg/common/db/controller/group.go:444:2: return with no blank line before (nlreturn) + return g.cache.DelGroupMembersInfo(groupID, userID).ExecDel(ctx) + ^ +pkg/common/db/controller/group.go:456:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/group.go:460:2: return with no blank line before (nlreturn) + return cache.ExecDel(ctx) + ^ +pkg/common/db/controller/group.go:471:3: return with no blank line before (nlreturn) + return db.Create(ctx, requests) + ^ +pkg/common/db/controller/group.go:506:2: return with no blank line before (nlreturn) + return g.cache.DelSuperGroupMemberIDs(groupID).DelJoinedSuperGroupIDs(initMemberIDs...).ExecDel(ctx) + ^ +pkg/common/db/controller/group.go:523:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/group.go:527:2: return with no blank line before (nlreturn) + return cache.ExecDel(ctx) + ^ +pkg/common/db/controller/group.go:534:2: return with no blank line before (nlreturn) + return g.cache.DelSuperGroupMemberIDs(groupID).DelJoinedSuperGroupIDs(userIDs...).ExecDel(ctx) + ^ +pkg/common/db/controller/group.go:541:2: return with no blank line before (nlreturn) + return g.cache.DelSuperGroupMemberIDs(groupID).DelJoinedSuperGroupIDs(userIDs...).ExecDel(ctx) + ^ +pkg/common/db/controller/msg.go:138:2: return with no blank line before (nlreturn) + return CommonMsgDatabase + ^ +pkg/common/db/controller/msg.go:153:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/controller/msg.go:159:3: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/controller/msg.go:161:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/msg.go:168:3: return with no blank line before (nlreturn) + return 0, 0, err + ^ +pkg/common/db/controller/msg.go:170:2: return with no blank line before (nlreturn) + return partition, offset, nil + ^ +pkg/common/db/controller/msg.go:176:3: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/controller/msg.go:178:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/msg.go:181: Function 'BatchInsertBlock' has too many statements (66 > 50) (funlen) +func (db *commonMsgDatabase) BatchInsertBlock(ctx context.Context, conversationID string, fields []any, key int8, firstSeq int64) error { +pkg/common/db/controller/msg.go:223:3: return with no blank line before (nlreturn) + return res.MatchedCount > 0, nil + ^ +pkg/common/db/controller/msg.go:272:5: continue with no blank line before (nlreturn) + continue + ^ +pkg/common/db/controller/msg.go:274:4: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/controller/msg.go:279:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/msg.go:325:2: return with no blank line before (nlreturn) + return db.BatchInsertBlock(ctx, conversationID, msgs, updateKeyMsg, msgList[0].Seq) + ^ +pkg/common/db/controller/msg.go:341:4: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/controller/msg.go:344:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/msg.go:357:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +pkg/common/db/controller/msg.go:359:3: return with no blank line before (nlreturn) + return 0, false, err + ^ +pkg/common/db/controller/msg.go:369:5: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if errs.Unwrap(err) == redis.Nil { + ^ +pkg/common/db/controller/msg.go:399:2: return with no blank line before (nlreturn) + return lastMaxSeq, isNew, utils.Wrap(err, "") + ^ +pkg/common/db/controller/msg.go:413:2: return with no blank line before (nlreturn) + return totalMsgs, nil + ^ +pkg/common/db/controller/msg.go:423:2: return with no blank line before (nlreturn) + return msgs, err + ^ +pkg/common/db/controller/msg.go:441:2: return with no blank line before (nlreturn) + return seqMsgs, nil + ^ +pkg/common/db/controller/msg.go:444: Function 'GetMsgBySeqsRange' has too many statements (77 > 50) (funlen) +func (db *commonMsgDatabase) GetMsgBySeqsRange(ctx context.Context, userID string, conversationID string, begin, end, num, userMaxSeq int64) (int64, int64, []*sdkws.MsgData, error) { +pkg/common/db/controller/msg.go:446:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +pkg/common/db/controller/msg.go:450:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +pkg/common/db/controller/msg.go:458:3: return with no blank line before (nlreturn) + return 0, 0, nil, nil + ^ +pkg/common/db/controller/msg.go:461:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +pkg/common/db/controller/msg.go:495:6: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != redis.Nil { + ^ +pkg/common/db/controller/msg.go:501:2: `if len(cachedMsgs) > 0` has complex nested blocks (complexity: 13) (nestif) + if len(cachedMsgs) > 0 { + ^ +pkg/common/db/controller/msg.go:503:20: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +pkg/common/db/controller/msg.go:532:8: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != redis.Nil { + ^ +pkg/common/db/controller/msg.go:551:4: return with no blank line before (nlreturn) + return 0, 0, nil, err + ^ +pkg/common/db/controller/msg.go:562:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +pkg/common/db/controller/msg.go:566:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +pkg/common/db/controller/msg.go:570:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +pkg/common/db/controller/msg.go:584:6: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != redis.Nil { + ^ +pkg/common/db/controller/msg.go:610:4: return with no blank line before (nlreturn) + return 0, 0, nil, err + ^ +pkg/common/db/controller/msg.go:615:2: return with no blank line before (nlreturn) + return minSeq, maxSeq, successMsgs, nil + ^ +pkg/common/db/controller/msg.go:635:2: return with no blank line before (nlreturn) + return db.cache.SetMinSeq(ctx, conversationID, minSeq) + ^ +pkg/common/db/controller/msg.go:638:1: cognitive complexity 41 of func `(*commonMsgDatabase).UserMsgsDestruct` is high (> 30) (gocognit) +func (db *commonMsgDatabase) UserMsgsDestruct(ctx context.Context, userID string, conversationID string, destructTime int64, lastMsgDestructTime time.Time) (seqs []int64, err error) { +^ +pkg/common/db/controller/msg.go:643:3: `if err != nil || msgDocModel.DocID == ""` has complex nested blocks (complexity: 4) (nestif) + if err != nil || msgDocModel.DocID == "" { + ^ +pkg/common/db/controller/msg.go:645:8: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == unrelation.ErrMsgListNotExist { + ^ +pkg/common/db/controller/msg.go:656:3: `if len(msgDocModel.Msg) > 0` has complex nested blocks (complexity: 5) (nestif) + if len(msgDocModel.Msg) > 0 { + ^ +pkg/common/db/controller/msg.go:668:6: break with no blank line before (nlreturn) + break + ^ +pkg/common/db/controller/msg.go:678:2: `if len(seqs) > 0` has complex nested blocks (complexity: 4) (nestif) + if len(seqs) > 0 { + ^ +pkg/common/db/controller/msg.go:681:20: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +pkg/common/db/controller/msg.go:690:2: return with no blank line before (nlreturn) + return seqs, nil + ^ +pkg/common/db/controller/msg.go:710:2: `if err != nil || msgDocModel.DocID == ""` has complex nested blocks (complexity: 5) (nestif) + if err != nil || msgDocModel.DocID == "" { + ^ +pkg/common/db/controller/msg.go:712:7: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == unrelation.ErrMsgListNotExist { + ^ +pkg/common/db/controller/msg.go:723:3: return with no blank line before (nlreturn) + return delStruct.getSetMinSeq() + 1, nil + ^ +pkg/common/db/controller/msg.go:729:2: `if msgDocModel.IsFull() && msgDocModel.Msg[len(msgDocModel.Msg)-1].Msg.SendTime+(remainTime*1000) < utils.GetCurrentTimestampByMill()` has complex nested blocks (complexity: 7) (nestif) + if msgDocModel.IsFull() && msgDocModel.Msg[len(msgDocModel.Msg)-1].Msg.SendTime+(remainTime*1000) < utils.GetCurrentTimestampByMill() { + ^ +pkg/common/db/controller/msg.go:743:7: shadow: declaration of "err" shadows declaration at line 709 (govet) + if err := db.msgDocDatabase.DeleteMsgsInOneDocByIndex(ctx, msgDocModel.DocID, delMsgIndexs); err != nil { + ^ +pkg/common/db/controller/msg.go:746:28: unnecessary conversion (unconvert) + delStruct.minSeq = int64(msgDocModel.Msg[delMsgIndexs[len(delMsgIndexs)-1]].Msg.Seq) + ^ +pkg/common/db/controller/msg.go:750:2: return with no blank line before (nlreturn) + return seq, err + ^ +pkg/common/db/controller/msg.go:766:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/msg.go:771:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err != nil && errs.Unwrap(err) != redis.Nil { + ^ +pkg/common/db/controller/msg.go:773:3: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/controller/msg.go:792:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/msg.go:803:7: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if err == redis.Nil { + ^ +pkg/common/db/controller/msg.go:808:4: continue with no blank line before (nlreturn) + continue + ^ +pkg/common/db/controller/msg.go:901:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/controller/msg.go:919:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/controller/msg.go:946:2: Consider pre-allocating `totalMsgs` (prealloc) + var totalMsgs []*sdkws.MsgData + ^ +pkg/common/db/controller/msg.go:957:2: return with no blank line before (nlreturn) + return total, totalMsgs, nil + ^ +pkg/common/db/controller/s3.go:92:2: return with no blank line before (nlreturn) + return expireTime, rawURL, nil + ^ +pkg/common/db/controller/user.go:93:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/user.go:105:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/controller/user.go:111:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/controller/user.go:116:5: shadow: declaration of "err" shadows declaration at line 115 (govet) + if err := u.tx.Transaction(func(tx any) error { + ^ +pkg/common/db/controller/user.go:121:3: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/controller/user.go:125:2: Consider pre-allocating `userIDs` (prealloc) + var userIDs []string + ^ +pkg/common/db/controller/user.go:129:2: return with no blank line before (nlreturn) + return u.cache.DelUsersInfo(userIDs...).ExecDel(ctx) + ^ +pkg/common/db/controller/user.go:137:2: return with no blank line before (nlreturn) + return u.cache.DelUsersInfo(user.UserID).ExecDel(ctx) + ^ +pkg/common/db/controller/user.go:145:2: return with no blank line before (nlreturn) + return u.cache.DelUsersInfo(userID).ExecDel(ctx) + ^ +pkg/common/db/controller/user.go:165:2: return with no blank line before (nlreturn) + return false, nil + ^ +pkg/common/db/controller/user.go:186:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/controller/user.go:192:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/controller/user.go:201:2: return with no blank line before (nlreturn) + return list, nil + ^ +pkg/common/db/controller/user.go:210:2: return with no blank line before (nlreturn) + return list, nil + ^ +pkg/common/db/controller/user.go:216:2: return with no blank line before (nlreturn) + return onlineStatusList, err + ^ +pkg/common/db/localcache/conversation.go:53:2: return with no blank line before (nlreturn) + return resp.UserIDs, nil + ^ +pkg/common/db/localcache/conversation.go:77:3: return with no blank line before (nlreturn) + return conversationIDsResp.ConversationIDs, nil + ^ +pkg/common/db/localcache/conversation.go:79:2: return with no blank line before (nlreturn) + return hash.ids, nil + ^ +pkg/common/db/localcache/group.go:71:2: return with no blank line before (nlreturn) + return g.cache[groupID].userIDs, nil + ^ +pkg/common/db/relation/black_model.go:66:2: Consider pre-allocating `where` (prealloc) + var where [][]interface{} + ^ +pkg/common/db/relation/black_model.go:70:2: return with no blank line before (nlreturn) + return blackList, utils.Wrap( + ^ +pkg/common/db/relation/black_model.go:78:2: return with no blank line before (nlreturn) + return black, utils.Wrap( + ^ +pkg/common/db/relation/black_model.go:99:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/relation/chat_log_model.go:18:2: SA1019: "github.com/golang/protobuf/jsonpb" is deprecated: Use the "google.golang.org/protobuf/encoding/protojson" package instead. (staticcheck) + "github.com/golang/protobuf/jsonpb" + ^ +pkg/common/db/relation/chat_log_model.go:41:13: Error return value of `copier.Copy` is not checked (errcheck) + copier.Copy(chatLog, msg.MsgData) + ^ +pkg/common/db/relation/chat_log_model.go:62:2: return with no blank line before (nlreturn) + return c.DB.Create(chatLog).Error + ^ +pkg/common/db/relation/conversation_model.go:57:2: return with no blank line before (nlreturn) + return result.RowsAffected, utils.Wrap(result.Error, "") + ^ +pkg/common/db/relation/conversation_model.go:82:2: return with no blank line before (nlreturn) + return conversations, err + ^ +pkg/common/db/relation/conversation_model.go:90:2: return with no blank line before (nlreturn) + return cc, utils.Wrap( + ^ +pkg/common/db/relation/conversation_model.go:172:2: return with no blank line before (nlreturn) + return int( + ^ +pkg/common/db/relation/conversation_model.go:222:2: return with no blank line before (nlreturn) + return recvMsgOpt, errs.Wrap( + ^ +pkg/common/db/relation/conversation_model.go:233:2: return with no blank line before (nlreturn) + return userIDs, errs.Wrap( + ^ +pkg/common/db/relation/friend_model.go:53:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/relation/friend_model.go:87:2: return with no blank line before (nlreturn) + return utils.Wrap(f.db(ctx).Where("owner_user_id = ?", ownerUserID).Updates(m).Error, "") + ^ +pkg/common/db/relation/friend_model.go:96:2: return with no blank line before (nlreturn) + return friend, utils.Wrap( + ^ +pkg/common/db/relation/friend_model.go:159:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/relation/friend_model.go:181:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/relation/friend_request_model.go:77:2: return with no blank line before (nlreturn) + return utils.Wrap( + ^ +pkg/common/db/relation/friend_request_model.go:96:2: return with no blank line before (nlreturn) + return friendRequest, err + ^ +pkg/common/db/relation/friend_request_model.go:108:2: return with no blank line before (nlreturn) + return friendRequest, err + ^ +pkg/common/db/relation/friend_request_model.go:130:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/relation/friend_request_model.go:152:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/relation/friend_request_model.go:163:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/relation/group_member_model.go:71:2: return with no blank line before (nlreturn) + return db.RowsAffected, utils.Wrap(db.Error, "") + ^ +pkg/common/db/relation/group_member_model.go:90:2: return with no blank line before (nlreturn) + return groupMembers, utils.Wrap(db.Find(&groupMembers).Error, "") + ^ +pkg/common/db/relation/group_member_model.go:99:2: return with no blank line before (nlreturn) + return groupMember, utils.Wrap( + ^ +pkg/common/db/relation/group_member_model.go:110:2: return with no blank line before (nlreturn) + return groupMember, utils.Wrap( + ^ +pkg/common/db/relation/group_member_model.go:128:2: return with no blank line before (nlreturn) + return ormutil.GormSearch[relation.GroupMemberModel](db, []string{"nickname"}, keyword, pageNumber, showNumber) + ^ +pkg/common/db/relation/group_member_model.go:155:2: return with no blank line before (nlreturn) + return groupUsers, nil + ^ +pkg/common/db/relation/group_member_model.go:185:2: return with no blank line before (nlreturn) + return result, nil + ^ +pkg/common/db/relation/group_model.go:64:2: return with no blank line before (nlreturn) + return group, utils.Wrap(g.DB.Where("group_id = ?", groupID).Take(group).Error, "") + ^ +pkg/common/db/relation/group_model.go:70:2: return with no blank line before (nlreturn) + return ormutil.GormSearch[relation.GroupModel](db, []string{"name"}, keyword, pageNumber, showNumber) + ^ +pkg/common/db/relation/group_model.go:85:2: return with no blank line before (nlreturn) + return count, nil + ^ +pkg/common/db/relation/group_model.go:101:2: return with no blank line before (nlreturn) + return v, nil + ^ +pkg/common/db/relation/group_request_model.go:83:2: return with no blank line before (nlreturn) + return groupRequest, utils.Wrap( + ^ +pkg/common/db/relation/group_request_model.go:117:2: return with no blank line before (nlreturn) + return int64(len(groupRequests)), groupRequests, utils.Wrap(err, utils.GetSelfFuncName()) + ^ +pkg/common/db/relation/log_model.go:27:2: return with no blank line before (nlreturn) + return ormutil.GormSearch[relationtb.Log](db, []string{"user_id"}, keyword, pageNumber, showNumber) + ^ +pkg/common/db/relation/log_model.go:34:2: return with no blank line before (nlreturn) + return errs.Wrap(l.db.WithContext(ctx).Where("log_id in ? and user_id=?", logIDs, userID).Delete(&relationtb.Log{}).Error) + ^ +pkg/common/db/relation/log_model.go:42:2: return with no blank line before (nlreturn) + return logs, errs.Wrap(l.db.WithContext(ctx).Where("log_id in ? and user_id=?", logIDs, userID).Find(&logs).Error) + ^ +pkg/common/db/relation/log_model.go:46:16: Error return value of `db.AutoMigrate` is not checked (errcheck) + db.AutoMigrate(&relationtb.Log{}) + ^ +pkg/common/db/relation/log_model.go:47:2: return with no blank line before (nlreturn) + return &LogGorm{db: db} + ^ +pkg/common/db/relation/meta_db.go:37:2: return with no blank line before (nlreturn) + return db + ^ +pkg/common/db/relation/mysql_init.go:85:2: return with no blank line before (nlreturn) + return db, nil + ^ +pkg/common/db/relation/mysql_init.go:97:22: type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint) + if mysqlErr, ok := err.(*mysqldriver.MySQLError); ok && mysqlErr.Number == 1045 { + ^ +pkg/common/db/relation/mysql_init.go:102:2: return with no blank line before (nlreturn) + return nil, err + ^ +pkg/common/db/relation/mysql_init.go:109:2: return with no blank line before (nlreturn) + return newMysqlGormDB() + ^ +pkg/common/db/relation/mysql_init.go:116:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/relation/mysql_init.go:120:21: type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint) + if mysqlErr, ok := err.(*mysqldriver.MySQLError); ok { + ^ +pkg/common/db/relation/mysql_init.go:123:2: return with no blank line before (nlreturn) + return false + ^ +pkg/common/db/relation/object_model.go:47:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/relation/object_model.go:52:2: return with no blank line before (nlreturn) + return info, errs.Wrap(o.DB.WithContext(ctx).Where("name = ?", name).Take(info).Error) + ^ +pkg/common/db/relation/user_model.go:56:2: return with no blank line before (nlreturn) + return users, err + ^ +pkg/common/db/relation/user_model.go:63:2: return with no blank line before (nlreturn) + return user, err + ^ +pkg/common/db/relation/user_model.go:84:2: return with no blank line before (nlreturn) + return + ^ +pkg/common/db/relation/user_model.go:91:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + return userIDs, errs.Wrap(u.db(ctx).Limit(int(showNumber)).Offset(int((pageNumber-1)*showNumber)).Pluck("user_id", &userIDs).Error) + } +pkg/common/db/relation/user_model.go:98:2: return with no blank line before (nlreturn) + return opt, err + ^ +pkg/common/db/relation/user_model.go:109:2: return with no blank line before (nlreturn) + return count, nil + ^ +pkg/common/db/relation/user_model.go:135:2: return with no blank line before (nlreturn) + return v, nil + ^ +pkg/common/db/s3/cont/controller.go:49:2: return with no blank line before (nlreturn) + return path.Join( + ^ +pkg/common/db/s3/cont/controller.go:61:2: return with no blank line before (nlreturn) + return hex.EncodeToString(id[:]) + ^ +pkg/common/db/s3/cont/controller.go:95:15: S1028: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (gosimple) + return nil, errors.New(fmt.Sprintf("too many parts: %d", partNumber)) + ^ +pkg/common/db/s3/cont/controller.go:102:2: `if size <= partSize` has complex nested blocks (complexity: 7) (nestif) + if size <= partSize { + ^ +pkg/common/db/s3/cont/controller.go:109:3: return with no blank line before (nlreturn) + return &InitiateUploadResult{ + ^ +pkg/common/db/s3/cont/controller.go:127:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + // 分片上传 + upload, err := c.impl.InitiateMultipartUpload(ctx, c.HashPath(hash)) + if err != nil { + return nil, err + } + if maxParts < 0 { + maxParts = partNumber + } + var authSign *s3.AuthSignResult + if maxParts > 0 { + partNumbers := make([]int, partNumber) + for i := 0; i < maxParts; i++ { + partNumbers[i] = i + 1 + } + authSign, err = c.impl.AuthSign(ctx, upload.UploadID, upload.Key, time.Hour*24, partNumbers) + if err != nil { + return nil, err + } + } + return &InitiateUploadResult{ + UploadID: newMultipartUploadID(multipartUploadID{ + Type: UploadTypeMultipart, + ID: upload.UploadID, + Key: upload.Key, + Size: size, + Hash: hash, + }), + PartSize: partSize, + Sign: authSign, + }, nil + } +pkg/common/db/s3/cont/controller.go:147:3: return with no blank line before (nlreturn) + return &InitiateUploadResult{ + ^ +pkg/common/db/s3/cont/controller.go:167:15: G401: Use of weak cryptographic primitive (gosec) + if md5Sum := md5.Sum([]byte(strings.Join(partHashs, partSeparator))); hex.EncodeToString(md5Sum[:]) != upload.Hash { + ^ +pkg/common/db/s3/cont/controller.go:169:3: return with no blank line before (nlreturn) + return nil, errors.New("md5 mismatching") + ^ +pkg/common/db/s3/cont/controller.go:211:13: G401: Use of weak cryptographic primitive (gosec) + md5Sum := md5.Sum([]byte(strings.Join([]string{uploadInfo.ETag}, partSeparator))) + ^ +pkg/common/db/s3/cont/controller.go:233:2: return with no blank line before (nlreturn) + return &UploadResult{ + ^ +pkg/common/db/s3/cont/controller.go:264:2: return with no blank line before (nlreturn) + return c.impl.AccessURL(ctx, name, expire, opt) + ^ +pkg/common/db/s3/cont/id.go:36:2: return with no blank line before (nlreturn) + return base64.StdEncoding.EncodeToString(data) + ^ +pkg/common/db/s3/cont/id.go:48:2: return with no blank line before (nlreturn) + return &upload, nil + ^ +pkg/common/db/s3/cos/cos.go:48:2: const `videoSnapshotImagePng` is unused (unused) + videoSnapshotImagePng = "png" + ^ +pkg/common/db/s3/cos/cos.go:49:2: const `videoSnapshotImageJpg` is unused (unused) + videoSnapshotImageJpg = "jpg" + ^ +pkg/common/db/s3/cos/cos.go:65:2: return with no blank line before (nlreturn) + return &Cos{ + ^ +pkg/common/db/s3/cos/cos.go:95:2: return with no blank line before (nlreturn) + return &s3.InitiateMultipartUploadResult{ + ^ +pkg/common/db/s3/cos/cos.go:116:2: return with no blank line before (nlreturn) + return &s3.CompleteMultipartUploadResult{ + ^ +pkg/common/db/s3/cos/cos.go:138:2: return with no blank line before (nlreturn) + return partSize, nil + ^ +pkg/common/db/s3/cos/cos.go:160:2: return with no blank line before (nlreturn) + return &result, nil + ^ +pkg/common/db/s3/cos/cos.go:168:2: return with no blank line before (nlreturn) + return rawURL.String(), nil + ^ +pkg/common/db/s3/cos/cos.go:173:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/s3/cos/cos.go:190:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive) + } else { + res.Size, err = strconv.ParseInt(contentLengthStr, 10, 64) + if err != nil { + return nil, fmt.Errorf("StatObject content-length parse error: %w", err) + } + if res.Size < 0 { + return nil, errors.New("StatObject content-length must be greater than 0") + } + } +pkg/common/db/s3/cos/cos.go:201:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive) + } else { + res.LastModified, err = time.Parse(http.TimeFormat, lastModified) + if err != nil { + return nil, fmt.Errorf("StatObject last-modified parse error: %w", err) + } + } +pkg/common/db/s3/cos/cos.go:207:2: return with no blank line before (nlreturn) + return res, nil + ^ +pkg/common/db/s3/cos/cos.go:216:2: return with no blank line before (nlreturn) + return &s3.CopyObjectInfo{ + ^ +pkg/common/db/s3/cos/cos.go:223:14: type switch on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint) + switch e := err.(type) { + ^ +pkg/common/db/s3/cos/cos.go:233:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/s3/cos/cos.go:260:2: return with no blank line before (nlreturn) + return res, nil + ^ +pkg/common/db/s3/cos/cos.go:263:1: cognitive complexity 32 of func `(*Cos).AccessURL` is high (> 30) (gocognit) +func (c *Cos) AccessURL(ctx context.Context, name string, expire time.Duration, opt *s3.AccessURLOption) (string, error) { +^ +pkg/common/db/s3/cos/cos.go:266:2: `if opt != nil` has complex nested blocks (complexity: 12) (nestif) + if opt != nil { + ^ +pkg/common/db/s3/cos/cos.go:320:2: return with no blank line before (nlreturn) + return rawURL.String(), nil + ^ +pkg/common/db/s3/cos/cos.go:327:2: return with no blank line before (nlreturn) + return c.client.Object.GetObjectURL(name), nil + ^ +pkg/common/db/s3/minio/image.go:42:2: return with no blank line before (nlreturn) + return bounds.X, bounds.Y + ^ +pkg/common/db/s3/minio/minio.go:109:2: return with no blank line before (nlreturn) + return m, nil + ^ +pkg/common/db/s3/minio/minio.go:138:6: shadow: declaration of "err" shadows declaration at line 133 (govet) + if err := m.core.Client.MakeBucket(ctx, conf.Bucket, minio.MakeBucketOptions{}); err != nil { + ^ +pkg/common/db/s3/minio/minio.go:147:6: shadow: declaration of "err" shadows declaration at line 133 (govet) + if err := m.core.Client.SetBucketPolicy(ctx, conf.Bucket, policy); err != nil { + ^ +pkg/common/db/s3/minio/minio.go:179:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/s3/minio/minio.go:202:2: return with no blank line before (nlreturn) + return &s3.InitiateMultipartUploadResult{ + ^ +pkg/common/db/s3/minio/minio.go:224:2: return with no blank line before (nlreturn) + return &s3.CompleteMultipartUploadResult{ + ^ +pkg/common/db/s3/minio/minio.go:246:2: return with no blank line before (nlreturn) + return partSize, nil + ^ +pkg/common/db/s3/minio/minio.go:277:2: return with no blank line before (nlreturn) + return &result, nil + ^ +pkg/common/db/s3/minio/minio.go:288:2: return with no blank line before (nlreturn) + return rawURL.String(), nil + ^ +pkg/common/db/s3/minio/minio.go:295:2: return with no blank line before (nlreturn) + return m.core.Client.RemoveObject(ctx, m.bucket, name, minio.RemoveObjectOptions{}) + ^ +pkg/common/db/s3/minio/minio.go:306:2: return with no blank line before (nlreturn) + return &s3.ObjectInfo{ + ^ +pkg/common/db/s3/minio/minio.go:328:2: return with no blank line before (nlreturn) + return &s3.CopyObjectInfo{ + ^ +pkg/common/db/s3/minio/minio.go:338:14: type switch on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint) + switch e := err.(type) { + ^ +pkg/common/db/s3/minio/minio.go:352:2: return with no blank line before (nlreturn) + return m.core.AbortMultipartUpload(ctx, m.bucket, name, uploadID) + ^ +pkg/common/db/s3/minio/minio.go:378:2: return with no blank line before (nlreturn) + return res, nil + ^ +pkg/common/db/s3/minio/minio.go:399:2: return with no blank line before (nlreturn) + return rawURL.String(), nil + ^ +pkg/common/db/s3/minio/minio.go:402: Function 'AccessURL' has too many statements (63 > 50) (funlen) +func (m *Minio) AccessURL(ctx context.Context, name string, expire time.Duration, opt *s3.AccessURLOption) (string, error) { +pkg/common/db/s3/minio/minio.go:431:2: `if err == nil` has complex nested blocks (complexity: 9) (nestif) + if err == nil { + ^ +pkg/common/db/s3/minio/minio.go:432:6: shadow: declaration of "err" shadows declaration at line 418 (govet) + if err := json.Unmarshal(data, &info); err != nil { + ^ +pkg/common/db/s3/minio/minio.go:439:11: shadow: declaration of "err" shadows declaration at line 418 (govet) + reader, err := m.core.Client.GetObject(ctx, m.bucket, name, minio.GetObjectOptions{}) + ^ +pkg/common/db/s3/minio/minio.go:489:8: shadow: declaration of "err" shadows declaration at line 418 (govet) + if _, err := m.core.Client.StatObject(ctx, m.bucket, cacheKey, minio.StatObjectOptions{}); err == nil { + ^ +pkg/common/db/s3/minio/minio.go:495:11: shadow: declaration of "err" shadows declaration at line 418 (govet) + reader, err := m.core.Client.GetObject(ctx, m.bucket, name, minio.GetObjectOptions{}) + ^ +pkg/common/db/s3/minio/minio.go:509:3: ineffectual assignment to err (ineffassign) + err = png.Encode(buf, thumbnail) + ^ +pkg/common/db/s3/minio/minio.go:511:3: ineffectual assignment to err (ineffassign) + err = jpeg.Encode(buf, thumbnail, nil) + ^ +pkg/common/db/s3/minio/minio.go:513:3: ineffectual assignment to err (ineffassign) + err = gif.Encode(buf, thumbnail, nil) + ^ +pkg/common/db/s3/minio/minio.go:518:2: return with no blank line before (nlreturn) + return m.presignedGetObject(ctx, cacheKey, expire, reqParams) + ^ +pkg/common/db/s3/minio/minio.go:530:2: return with no blank line before (nlreturn) + return io.ReadAll(io.LimitReader(object, 1024)) + ^ +pkg/common/db/s3/oss/oss.go:49:2: const `videoSnapshotImagePng` is unused (unused) + videoSnapshotImagePng = "png" + ^ +pkg/common/db/s3/oss/oss.go:50:2: const `videoSnapshotImageJpg` is unused (unused) + videoSnapshotImageJpg = "jpg" + ^ +pkg/common/db/s3/oss/oss.go:69:2: return with no blank line before (nlreturn) + return &OSS{ + ^ +pkg/common/db/s3/oss/oss.go:101:2: return with no blank line before (nlreturn) + return &s3.InitiateMultipartUploadResult{ + ^ +pkg/common/db/s3/oss/oss.go:124:2: return with no blank line before (nlreturn) + return &s3.CompleteMultipartUploadResult{ + ^ +pkg/common/db/s3/oss/oss.go:146:2: return with no blank line before (nlreturn) + return partSize, nil + ^ +pkg/common/db/s3/oss/oss.go:158:34: should rewrite http.NewRequestWithContext or add (*Request).WithContext (noctx) + request, err := http.NewRequest(http.MethodPut, rawURL, nil) + ^ +pkg/common/db/s3/oss/oss.go:178:2: return with no blank line before (nlreturn) + return &result, nil + ^ +pkg/common/db/s3/oss/oss.go:196:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive) + } else { + res.Size, err = strconv.ParseInt(contentLengthStr, 10, 64) + if err != nil { + return nil, fmt.Errorf("StatObject content-length parse error: %w", err) + } + if res.Size < 0 { + return nil, errors.New("StatObject content-length must be greater than 0") + } + } +pkg/common/db/s3/oss/oss.go:207:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive) + } else { + res.LastModified, err = time.Parse(http.TimeFormat, lastModified) + if err != nil { + return nil, fmt.Errorf("StatObject last-modified parse error: %w", err) + } + } +pkg/common/db/s3/oss/oss.go:213:2: return with no blank line before (nlreturn) + return res, nil + ^ +pkg/common/db/s3/oss/oss.go:225:2: return with no blank line before (nlreturn) + return &s3.CopyObjectInfo{ + ^ +pkg/common/db/s3/oss/oss.go:232:14: type switch on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint) + switch e := err.(type) { + ^ +pkg/common/db/s3/oss/oss.go:274:2: return with no blank line before (nlreturn) + return res, nil + ^ +pkg/common/db/s3/oss/oss.go:280:2: `if opt != nil` has complex nested blocks (complexity: 10) (nestif) + if opt != nil { + ^ +pkg/common/db/s3/oss/oss.go:328:2: return with no blank line before (nlreturn) + return getURL(o.um, o.bucket.BucketName, name, params).String(), nil + ^ +pkg/common/db/table/relation/group.go:33:35: SA5008: invalid JSON field name "ex;size:1024" (staticcheck) + Ex string `gorm:"column:ex" json:"ex;size:1024"` + ^ +pkg/common/db/table/relation/utils.go:35:9: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + return utils.Unwrap(err) == gorm.ErrRecordNotFound + ^ +pkg/common/db/table/unrelation/msg.go:153:2: return with no blank line before (nlreturn) + return m.indexGen(conversationID, seqSuffix) + ^ +pkg/common/db/table/unrelation/msg.go:167:2: return with no blank line before (nlreturn) + return t + ^ +pkg/common/db/table/unrelation/msg.go:184:2: return with no blank line before (nlreturn) + return exceptionMsg + ^ +pkg/common/db/unrelation/mongo.go:47:2: ineffectual assignment to uri (ineffassign) + uri := "mongodb://sample.host:27017/?maxPoolSize=20&w=majority" + ^ +pkg/common/db/unrelation/mongo.go:48:2: `if config.Config.Mongo.Uri != ""` has complex nested blocks (complexity: 5) (nestif) + if config.Config.Mongo.Uri != "" { + ^ +pkg/common/db/unrelation/mongo.go:79:20: type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint) + if cmdErr, ok := err.(mongo.CommandError); ok { + ^ +pkg/common/db/unrelation/mongo.go:82:11: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + fmt.Printf("Failed to connect to MongoDB: %s\n", err) + } +pkg/common/db/unrelation/mongo.go:87:2: return with no blank line before (nlreturn) + return nil, err + ^ +pkg/common/db/unrelation/mongo.go:109:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/unrelation/mongo.go:142:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/unrelation/msg.go:52:2: return with no blank line before (nlreturn) + return &MsgMongoDriver{MsgCollection: collection} + ^ +pkg/common/db/unrelation/msg.go:62:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/unrelation/msg.go:84:2: return with no blank line before (nlreturn) + return res, nil + ^ +pkg/common/db/unrelation/msg.go:111:2: return with no blank line before (nlreturn) + return res, nil + ^ +pkg/common/db/unrelation/msg.go:123:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/unrelation/msg.go:146:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/unrelation/msg.go:152:2: return with no blank line before (nlreturn) + return doc, err + ^ +pkg/common/db/unrelation/msg.go:180:2: return with no blank line before (nlreturn) + return nil, ErrMsgListNotExist + ^ +pkg/common/db/unrelation/msg.go:228:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/unrelation/msg.go:236:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/unrelation/msg.go:251:4: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$match", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:252:5: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"doc_id", docID}, + ^ +pkg/common/db/unrelation/msg.go:256:4: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$project", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:257:5: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"_id", 0}, + ^ +pkg/common/db/unrelation/msg.go:258:5: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"doc_id", 1}, + ^ +pkg/common/db/unrelation/msg.go:259:5: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"msgs", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:260:6: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$map", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:261:7: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"input", indexs}, + ^ +pkg/common/db/unrelation/msg.go:262:7: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"as", "index"}, + ^ +pkg/common/db/unrelation/msg.go:263:7: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"in", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:264:8: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$let", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:265:9: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"vars", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:266:10: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"currentMsg", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:267:11: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$arrayElemAt", []string{"$msgs", "$$index"}}, + ^ +pkg/common/db/unrelation/msg.go:270:9: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"in", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:271:10: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$cond", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:272:11: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"if", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:273:12: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$in", []string{userID, "$$currentMsg.del_list"}}, + ^ +pkg/common/db/unrelation/msg.go:275:11: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"then", nil}, + ^ +pkg/common/db/unrelation/msg.go:276:11: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"else", "$$currentMsg"}, + ^ +pkg/common/db/unrelation/msg.go:286:4: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$project", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:287:5: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"msgs.del_list", 0}, + ^ +pkg/common/db/unrelation/msg.go:339:2: return with no blank line before (nlreturn) + return msgs, nil + ^ +pkg/common/db/unrelation/msg.go:347:2: return with no blank line before (nlreturn) + return count > 0, nil + ^ +pkg/common/db/unrelation/msg.go:375:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/db/unrelation/msg.go:563: Function 'RangeUserSendCount' is too long (258 > 150) (funlen) +func (m *MsgMongoDriver) RangeUserSendCount( +pkg/common/db/unrelation/msg.go:804:5: shadow: declaration of "err" shadows declaration at line 571 (govet) + if err := cur.All(ctx, &result); err != nil { + ^ +pkg/common/db/unrelation/msg.go:821:2: return with no blank line before (nlreturn) + return result[0].MsgCount, result[0].UserCount, users, dateCount, nil + ^ +pkg/common/db/unrelation/msg.go:824: Function 'RangeGroupSendCount' is too long (246 > 150) (funlen) +func (m *MsgMongoDriver) RangeGroupSendCount( +pkg/common/db/unrelation/msg.go:1053:5: shadow: declaration of "err" shadows declaration at line 831 (govet) + if err := cur.All(ctx, &result); err != nil { + ^ +pkg/common/db/unrelation/msg.go:1070:2: return with no blank line before (nlreturn) + return result[0].MsgCount, result[0].UserCount, groups, dateCount, nil + ^ +pkg/common/db/unrelation/msg.go:1078:2: return with no blank line before (nlreturn) + return total, msgs, nil + ^ +pkg/common/db/unrelation/msg.go:1125:4: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$match", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:1126:5: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + { + ^ +pkg/common/db/unrelation/msg.go:1132:4: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$project", bson.D{ + ^ +pkg/common/db/unrelation/msg.go:1133:5: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + { + ^ +pkg/common/db/unrelation/msg.go:1135:7: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + { + ^ +pkg/common/db/unrelation/msg.go:1137:9: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"input", "$msgs"}, + ^ +pkg/common/db/unrelation/msg.go:1138:9: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"as", "item"}, + ^ +pkg/common/db/unrelation/msg.go:1139:9: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + { + ^ +pkg/common/db/unrelation/msg.go:1141:11: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$and", condition}, + ^ +pkg/common/db/unrelation/msg.go:1148:5: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"doc_id", 1}, + ^ +pkg/common/db/unrelation/msg.go:1152:4: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$unwind", bson.M{"path": "$msgs"}}, + ^ +pkg/common/db/unrelation/msg.go:1155:4: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {"$sort", bson.M{"msgs.msg.send_time": -1}}, + ^ +pkg/common/db/unrelation/msg.go:1217:2: return with no blank line before (nlreturn) + return n, msgs, nil + ^ +pkg/common/db/unrelation/msg_convert.go:28:1: cognitive complexity 41 of func `(*MsgMongoDriver).ConvertMsgsDocLen` is high (> 30) (gocognit) +func (m *MsgMongoDriver) ConvertMsgsDocLen(ctx context.Context, conversationIDs []string) { +^ +pkg/common/db/unrelation/msg_convert.go:34:4: continue with no blank line before (nlreturn) + continue + ^ +pkg/common/db/unrelation/msg_convert.go:40:4: continue with no blank line before (nlreturn) + continue + ^ +pkg/common/db/unrelation/msg_convert.go:46:3: `if len(msgDocs[0].Msg) == int(m.model.GetSingleGocMsgNum5000())` has complex nested blocks (complexity: 9) (nestif) + if len(msgDocs[0].Msg) == int(m.model.GetSingleGocMsgNum5000()) { + ^ +pkg/common/db/unrelation/msg_convert.go:47:10: shadow: declaration of "err" shadows declaration at line 31 (govet) + if _, err := m.MsgCollection.DeleteMany(ctx, bson.M{"doc_id": regex}); err != nil { + ^ +pkg/common/db/unrelation/msg_convert.go:49:5: continue with no blank line before (nlreturn) + continue + ^ +pkg/common/db/unrelation/super_group.go:62:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/unrelation/super_group.go:72:2: return with no blank line before (nlreturn) + return group, nil + ^ +pkg/common/db/unrelation/super_group.go:89:2: return with no blank line before (nlreturn) + return groups, nil + ^ +pkg/common/db/unrelation/super_group.go:116:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/unrelation/super_group.go:132:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/unrelation/super_group.go:141:2: return with no blank line before (nlreturn) + return &user, utils.Wrap(err, "") + ^ +pkg/common/db/unrelation/super_group.go:152:2: return with no blank line before (nlreturn) + return s.RemoveGroupFromUser(ctx, groupID, group.MemberIDs) + ^ +pkg/common/db/unrelation/super_group.go:161:2: return with no blank line before (nlreturn) + return utils.Wrap(err, "") + ^ +pkg/common/db/unrelation/user.go:54:4: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {{"$match", bson.D{{"user_id", SubscriptionPrefix + userID}}}}, + ^ +pkg/common/db/unrelation/user.go:55:4: composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields (govet) + {{"$project", bson.D{{"count", bson.D{{"$size", "$user_id_list"}}}}}}, + ^ +pkg/common/db/unrelation/user.go:68:3: shadow: declaration of "err" shadows declaration at line 58 (govet) + err := cursor.Decode(&cnt) + ^ +pkg/common/db/unrelation/user.go:125:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/unrelation/user.go:142:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/db/unrelation/user.go:155:2: return with no blank line before (nlreturn) + return errs.Wrap(err) + ^ +pkg/common/db/unrelation/user.go:168:2: return with no blank line before (nlreturn) + return user.UserIDList, nil + ^ +pkg/common/db/unrelation/user.go:181:2: return with no blank line before (nlreturn) + return user.UserIDList, nil + ^ +pkg/common/http/http_client.go:37:2: shadow: declaration of "client" shadows declaration at line 34 (govet) + client := http.Client{Timeout: 5 * time.Second} + ^ +pkg/common/http/http_client.go:38:25: (*net/http.Client).Get must not be called (noctx) + resp, err := client.Get(url) + ^ +pkg/common/http/http_client.go:47:2: return with no blank line before (nlreturn) + return body, nil + ^ +pkg/common/http/http_client.go:86:2: return with no blank line before (nlreturn) + return result, nil + ^ +pkg/common/http/http_client.go:101:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/http/http_client.go:119:4: return with no blank line before (nlreturn) + return errs.ErrCallbackContinue + ^ +pkg/common/http/http_client.go:121:3: return with no blank line before (nlreturn) + return errs.ErrNetwork.Wrap(err.Error()) + ^ +pkg/common/http/http_client.go:126:4: return with no blank line before (nlreturn) + return errs.ErrCallbackContinue + ^ +pkg/common/http/http_client.go:128:3: return with no blank line before (nlreturn) + return errs.ErrData.Wrap(err.Error()) + ^ +pkg/common/http/http_client.go:130:2: return with no blank line before (nlreturn) + return output.Parse() + ^ +pkg/common/kafka/consumer_group.go:54:2: return with no blank line before (nlreturn) + return &MConsumerGroup{ + ^ +pkg/common/kafka/producer.go:70:4: return with no blank line before (nlreturn) + return &p + ^ +pkg/common/kafka/producer.go:86:2: return with no blank line before (nlreturn) + return &p + ^ +pkg/common/kafka/producer.go:94:2: return with no blank line before (nlreturn) + return []sarama.RecordHeader{ + ^ +pkg/common/kafka/producer.go:103:2: Consider pre-allocating `values` (prealloc) + var values []string + ^ +pkg/common/kafka/producer.go:107:2: return with no blank line before (nlreturn) + return mcontext.WithMustInfoCtx(values) // TODO + ^ +pkg/common/kafka/producer.go:137:2: return with no blank line before (nlreturn) + return partition, offset, utils.Wrap(err, "") + ^ +pkg/common/locker/message_locker.go:45:4: continue with no blank line before (nlreturn) + continue + ^ +pkg/common/locker/message_locker.go:50:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/locker/message_locker.go:58:4: continue with no blank line before (nlreturn) + continue + ^ +pkg/common/locker/message_locker.go:63:2: return with no blank line before (nlreturn) + return err + ^ +pkg/common/prome/gather.go:86:41: Metric: user_login Error: counter metrics should have "_total" suffix (promlinter) + UserLoginCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:96:44: Metric: user_register Error: counter metrics should have "_total" suffix (promlinter) + UserRegisterCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:106:45: Metric: seq_get_success Error: counter metrics should have "_total" suffix (promlinter) + SeqGetSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:116:44: Metric: seq_get_failed Error: counter metrics should have "_total" suffix (promlinter) + SeqGetFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:126:45: Metric: seq_set_success Error: counter metrics should have "_total" suffix (promlinter) + SeqSetSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:136:44: Metric: seq_set_failed Error: counter metrics should have "_total" suffix (promlinter) + SeqSetFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:146:42: Metric: api_request Error: counter metrics should have "_total" suffix (promlinter) + ApiRequestCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:156:49: Metric: api_request_success Error: counter metrics should have "_total" suffix (promlinter) + ApiRequestSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:166:48: Metric: api_request_failed Error: counter metrics should have "_total" suffix (promlinter) + ApiRequestFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:176:43: Metric: grpc_request Error: counter metrics should have "_total" suffix (promlinter) + GrpcRequestCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:186:50: Metric: grpc_request_success Error: counter metrics should have "_total" suffix (promlinter) + GrpcRequestSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:196:49: Metric: grpc_request_failed Error: counter metrics should have "_total" suffix (promlinter) + GrpcRequestFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:206:39: Metric: send_msg Error: counter metrics should have "_total" suffix (promlinter) + SendMsgCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:216:53: Metric: msg_insert_redis_success Error: counter metrics should have "_total" suffix (promlinter) + MsgInsertRedisSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:226:52: Metric: msg_insert_redis_failed Error: counter metrics should have "_total" suffix (promlinter) + MsgInsertRedisFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:236:53: Metric: msg_insert_mongo_success Error: counter metrics should have "_total" suffix (promlinter) + MsgInsertMongoSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:246:52: Metric: msg_insert_mongo_failed Error: counter metrics should have "_total" suffix (promlinter) + MsgInsertMongoFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:256:55: Metric: msg_pull_from_redis_success Error: counter metrics should have "_total" suffix (promlinter) + MsgPullFromRedisSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:266:54: Metric: msg_pull_from_redis_failed Error: counter metrics should have "_total" suffix (promlinter) + MsgPullFromRedisFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:276:55: Metric: msg_pull_from_mongo_success Error: counter metrics should have "_total" suffix (promlinter) + MsgPullFromMongoSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:286:54: Metric: msg_pull_from_mongo_failed Error: counter metrics should have "_total" suffix (promlinter) + MsgPullFromMongoFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:326:56: Metric: single_chat_msg_recv_success Error: counter metrics should have "_total" suffix (promlinter) + SingleChatMsgRecvSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:336:55: Metric: group_chat_msg_recv_success Error: counter metrics should have "_total" suffix (promlinter) + GroupChatMsgRecvSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:346:64: Metric: work_super_group_chat_msg_recv_success Error: counter metrics should have "_total" suffix (promlinter) + WorkSuperGroupChatMsgRecvSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:366:59: Metric: single_chat_msg_process_success Error: counter metrics should have "_total" suffix (promlinter) + SingleChatMsgProcessSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:376:58: Metric: single_chat_msg_process_failed Error: counter metrics should have "_total" suffix (promlinter) + SingleChatMsgProcessFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:386:58: Metric: group_chat_msg_process_success Error: counter metrics should have "_total" suffix (promlinter) + GroupChatMsgProcessSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:396:57: Metric: group_chat_msg_process_failed Error: counter metrics should have "_total" suffix (promlinter) + GroupChatMsgProcessFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:406:67: Metric: work_super_group_chat_msg_process_success Error: counter metrics should have "_total" suffix (promlinter) + WorkSuperGroupChatMsgProcessSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:416:66: Metric: work_super_group_chat_msg_process_failed Error: counter metrics should have "_total" suffix (promlinter) + WorkSuperGroupChatMsgProcessFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:426:52: Metric: msg_online_push_success Error: counter metrics should have "_total" suffix (promlinter) + MsgOnlinePushSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:436:53: Metric: msg_offline_push_success Error: counter metrics should have "_total" suffix (promlinter) + MsgOfflinePushSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:446:52: Metric: msg_offline_push_failed Error: counter metrics should have "_total" suffix (promlinter) + MsgOfflinePushFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:456:57: Metric: conversation_push_success Error: counter metrics should have "_total" suffix (promlinter) + ConversationCreateSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/gather.go:466:56: Metric: conversation_push_failed Error: counter metrics should have "_total" suffix (promlinter) + ConversationCreateFailedCounter = promauto.NewCounter(prometheus.CounterOpts{ + ^ +pkg/common/prome/prometheus.go:33:3: return with no blank line before (nlreturn) + return err + ^ +pkg/common/prome/prometheus.go:35:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/common/prome/prometheus.go:40:2: return with no blank line before (nlreturn) + return func(c *gin.Context) { + ^ +pkg/common/prome/prometheus.go:52:2: return with no blank line before (nlreturn) + return r.ResponseWriter.Write(b) + ^ +pkg/common/startrpc/start.go:112:2: return with no blank line before (nlreturn) + return utils.Wrap1(srv.Serve(listener)) + ^ +pkg/common/tls/tls.go:32:12: SA1019: x509.DecryptPEMBlock has been deprecated since Go 1.16 because it shouldn't be used: Legacy PEM encryption as specified in RFC 1423 is insecure by design. Since it does not authenticate the ciphertext, it is vulnerable to padding oracle attacks that can let an attacker recover the plaintext. (staticcheck) + d, err := x509.DecryptPEMBlock(b, passphrase) + ^ +pkg/common/tls/tls.go:36:2: return with no blank line before (nlreturn) + return pem.EncodeToMemory(&pem.Block{ + ^ +pkg/common/tls/tls.go:47:2: return with no blank line before (nlreturn) + return decryptPEM(data, pwd) + ^ +pkg/msgprocessor/conversation.go:31:3: return with no blank line before (nlreturn) + return "n_" + strings.Join(l, "_") + ^ +pkg/msgprocessor/conversation.go:39:2: return with no blank line before (nlreturn) + return "" + ^ +pkg/msgprocessor/conversation.go:47:3: return with no blank line before (nlreturn) + return "si_" + strings.Join(l, "_") + ^ +pkg/msgprocessor/conversation.go:55:2: return with no blank line before (nlreturn) + return "" + ^ +pkg/msgprocessor/conversation.go:63:3: return with no blank line before (nlreturn) + return strings.Join(l, "_") + ^ +pkg/msgprocessor/conversation.go:67:2: return with no blank line before (nlreturn) + return "" + ^ +pkg/msgprocessor/conversation.go:79:3: return with no blank line before (nlreturn) + return "si_" + strings.Join(l, "_") // single chat + ^ +pkg/msgprocessor/conversation.go:84:3: return with no blank line before (nlreturn) + return "g_" + msg.GroupID // group chat + ^ +pkg/msgprocessor/conversation.go:89:3: return with no blank line before (nlreturn) + return "sg_" + msg.GroupID // super group chat + ^ +pkg/msgprocessor/conversation.go:94:3: return with no blank line before (nlreturn) + return "sn_" + msg.SendID + "_" + msg.RecvID // server notification chat + ^ +pkg/msgprocessor/conversation.go:96:2: return with no blank line before (nlreturn) + return "" + ^ +pkg/msgprocessor/conversation.go:114:2: return with no blank line before (nlreturn) + return "" + ^ +pkg/msgprocessor/conversation.go:121:3: return with no blank line before (nlreturn) + return strings.Join(l, "_") + ^ +pkg/msgprocessor/conversation.go:122:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive) + } else { + return "" + } +pkg/msgprocessor/conversation.go:138:2: return with no blank line before (nlreturn) + return "" + ^ +pkg/msgprocessor/conversation.go:158:3: return with no blank line before (nlreturn) + return false, "si_" + strings.Join(l, "_") // single chat + ^ +pkg/msgprocessor/conversation.go:163:3: return with no blank line before (nlreturn) + return false, "sg_" + msg.GroupID // super group chat + ^ +pkg/msgprocessor/conversation.go:168:3: return with no blank line before (nlreturn) + return false, "sn_" + msg.SendID + "_" + msg.RecvID // server notification chat + ^ +pkg/msgprocessor/conversation.go:170:2: return with no blank line before (nlreturn) + return false, "" + ^ +pkg/msgprocessor/conversation.go:192:2: return with no blank line before (nlreturn) + return string(s), nil + ^ +pkg/msgprocessor/options.go:41:2: return with no blank line before (nlreturn) + return options + ^ +pkg/msgprocessor/options.go:47:2: return with no blank line before (nlreturn) + return make(map[string]bool) + ^ +pkg/msgprocessor/options.go:54:2: return with no blank line before (nlreturn) + return options + ^ +pkg/msgprocessor/options.go:134:2: return with no blank line before (nlreturn) + return false + ^ +pkg/rpcclient/auth.go:34:2: return with no blank line before (nlreturn) + return &Auth{discov: discov, conn: conn, Client: client} + ^ +pkg/rpcclient/conversation.go:42:2: return with no blank line before (nlreturn) + return &Conversation{discov: discov, conn: conn, Client: client} + ^ +pkg/rpcclient/conversation.go:59:2: return with no blank line before (nlreturn) + return conversation.GetConversation().RecvMsgOpt, err + ^ +pkg/rpcclient/conversation.go:64:2: return with no blank line before (nlreturn) + return err + ^ +pkg/rpcclient/conversation.go:69:2: return with no blank line before (nlreturn) + return err + ^ +pkg/rpcclient/conversation.go:74:2: return with no blank line before (nlreturn) + return err + ^ +pkg/rpcclient/conversation.go:79:2: return with no blank line before (nlreturn) + return err + ^ +pkg/rpcclient/conversation.go:87:2: return with no blank line before (nlreturn) + return resp.ConversationIDs, nil + ^ +pkg/rpcclient/conversation.go:95:2: return with no blank line before (nlreturn) + return resp.Conversation, nil + ^ +pkg/rpcclient/conversation.go:109:2: return with no blank line before (nlreturn) + return resp.Conversations, nil + ^ +pkg/rpcclient/conversation.go:127:2: return with no blank line before (nlreturn) + return resp.Conversations, nil + ^ +pkg/rpcclient/friend.go:41:2: return with no blank line before (nlreturn) + return &Friend{discov: discov, conn: conn, Client: client} + ^ +pkg/rpcclient/friend.go:62:2: return with no blank line before (nlreturn) + return + ^ +pkg/rpcclient/friend.go:71:2: return with no blank line before (nlreturn) + return resp.InUser1Friends, nil + ^ +pkg/rpcclient/friend.go:80:2: return with no blank line before (nlreturn) + return resp.FriendIDs, nil + ^ +pkg/rpcclient/friend.go:88:2: return with no blank line before (nlreturn) + return r.InUser2Blacks, nil + ^ +pkg/rpcclient/group.go:45:2: return with no blank line before (nlreturn) + return &Group{discov: discov, conn: conn, Client: client} + ^ +pkg/rpcclient/group.go:72:2: return with no blank line before (nlreturn) + return resp.GroupInfos, nil + ^ +pkg/rpcclient/group.go:80:2: return with no blank line before (nlreturn) + return groups[0], nil + ^ +pkg/rpcclient/group.go:92:2: return with no blank line before (nlreturn) + return utils.SliceToMap(groups, func(e *sdkws.GroupInfo) string { + ^ +pkg/rpcclient/group.go:117:2: return with no blank line before (nlreturn) + return resp.Members, nil + ^ +pkg/rpcclient/group.go:129:2: return with no blank line before (nlreturn) + return members[0], nil + ^ +pkg/rpcclient/group.go:142:2: return with no blank line before (nlreturn) + return utils.SliceToMap(members, func(e *sdkws.GroupMemberFullInfo) string { + ^ +pkg/rpcclient/group.go:158:2: return with no blank line before (nlreturn) + return resp.Members, nil + ^ +pkg/rpcclient/group.go:166:2: return with no blank line before (nlreturn) + return resp.Members[0], err + ^ +pkg/rpcclient/group.go:176:2: return with no blank line before (nlreturn) + return resp.UserIDs, nil + ^ +pkg/rpcclient/group.go:186:2: return with no blank line before (nlreturn) + return resp.GroupInfo, nil + ^ +pkg/rpcclient/group.go:201:2: return with no blank line before (nlreturn) + return resp.Member, nil + ^ +pkg/rpcclient/group.go:209:2: return with no blank line before (nlreturn) + return err + ^ +pkg/rpcclient/group.go:216:2: return with no blank line before (nlreturn) + return err + ^ +pkg/rpcclient/msg.go:139:2: return with no blank line before (nlreturn) + return &Message{discov: discov, conn: conn, Client: client} + ^ +pkg/rpcclient/msg.go:150:2: return with no blank line before (nlreturn) + return resp, err + ^ +pkg/rpcclient/msg.go:155:2: return with no blank line before (nlreturn) + return resp, err + ^ +pkg/rpcclient/msg.go:160:2: return with no blank line before (nlreturn) + return resp, err + ^ +pkg/rpcclient/msg.go:168:2: return with no blank line before (nlreturn) + return resp.MaxSeq, nil + ^ +pkg/rpcclient/msg.go:203:2: return with no blank line before (nlreturn) + return notificationSender + ^ +pkg/rpcclient/msg.go:223:3: return with no blank line before (nlreturn) + return err + ^ +pkg/rpcclient/msg.go:232:13: shadow: declaration of "err" shadows declaration at line 218 (govet) + userInfo, err := s.getUserInfo(ctx, sendID) + ^ +pkg/rpcclient/msg.go:270:2: return with no blank line before (nlreturn) + return err + ^ +pkg/rpcclient/notification/conevrsation.go:44:2: return with no blank line before (nlreturn) + return c.Notification(ctx, sendID, recvID, constant.ConversationPrivateChatNotification, tips) + ^ +pkg/rpcclient/notification/conevrsation.go:53:2: return with no blank line before (nlreturn) + return c.Notification(ctx, userID, userID, constant.ConversationChangeNotification, tips) + ^ +pkg/rpcclient/notification/conevrsation.go:68:2: return with no blank line before (nlreturn) + return c.Notification(ctx, userID, userID, constant.ConversationUnreadNotification, tips) + ^ +pkg/rpcclient/notification/friend.go:60:4: return with no blank line before (nlreturn) + return result, nil + ^ +pkg/rpcclient/notification/friend.go:78:4: return with no blank line before (nlreturn) + return result, err + ^ +pkg/rpcclient/notification/friend.go:94:2: return with no blank line before (nlreturn) + return f + ^ +pkg/rpcclient/notification/friend.go:109:2: return with no blank line before (nlreturn) + return result, nil + ^ +pkg/rpcclient/notification/friend.go:112:36: func `(*FriendNotificationSender).getFromToUserNickname` is unused (unused) +func (f *FriendNotificationSender) getFromToUserNickname( + ^ +pkg/rpcclient/notification/friend.go:115:20: (*FriendNotificationSender).getFromToUserNickname - result 2 (error) is always nil (unparam) +) (string, string, error) { + ^ +pkg/rpcclient/notification/friend.go:118:3: error is not nil (line 116) but it returns nil (nilerr) + return "", "", nil + ^ +pkg/rpcclient/notification/friend.go:120:2: return with no blank line before (nlreturn) + return users[fromUserID].Nickname, users[toUserID].Nickname, nil + ^ +pkg/rpcclient/notification/friend.go:125:2: return with no blank line before (nlreturn) + return f.Notification(ctx, mcontext.GetOpUserID(ctx), changedUserID, constant.UserInfoUpdatedNotification, &tips) + ^ +pkg/rpcclient/notification/friend.go:136:2: return with no blank line before (nlreturn) + return f.Notification(ctx, req.FromUserID, req.ToUserID, constant.FriendApplicationNotification, &tips) + ^ +pkg/rpcclient/notification/friend.go:147:2: return with no blank line before (nlreturn) + return f.Notification(ctx, req.ToUserID, req.FromUserID, constant.FriendApplicationApprovedNotification, &tips) + ^ +pkg/rpcclient/notification/friend.go:158:2: return with no blank line before (nlreturn) + return f.Notification(ctx, req.ToUserID, req.FromUserID, constant.FriendApplicationRejectedNotification, &tips) + ^ +pkg/rpcclient/notification/friend.go:182:2: return with no blank line before (nlreturn) + return f.Notification(ctx, fromUserID, toUserID, constant.FriendAddedNotification, &tips) + ^ +pkg/rpcclient/notification/friend.go:190:2: return with no blank line before (nlreturn) + return f.Notification(ctx, req.OwnerUserID, req.FriendUserID, constant.FriendDeletedNotification, &tips) + ^ +pkg/rpcclient/notification/friend.go:197:2: return with no blank line before (nlreturn) + return f.Notification(ctx, fromUserID, toUserID, constant.FriendRemarkSetNotification, &tips) + ^ +pkg/rpcclient/notification/friend.go:204:2: return with no blank line before (nlreturn) + return f.Notification(ctx, req.OwnerUserID, req.BlackUserID, constant.BlackAddedNotification, &tips) + ^ +pkg/rpcclient/notification/friend.go:212:16: Error return value of `f.Notification` is not checked (errcheck) + f.Notification(ctx, req.OwnerUserID, req.BlackUserID, constant.BlackDeletedNotification, &blackDeletedTips) + ^ +pkg/rpcclient/notification/friend.go:221:16: Error return value of `f.Notification` is not checked (errcheck) + f.Notification(ctx, mcontext.GetOpUserID(ctx), needNotifiedUserID, constant.FriendInfoUpdatedNotification, &tips) + ^ +pkg/rpcclient/notification/group.go:63:2: return with no blank line before (nlreturn) + return &sdkws.PublicUserInfo{ + ^ +pkg/rpcclient/notification/group.go:84:2: return with no blank line before (nlreturn) + return &sdkws.GroupInfo{ + ^ +pkg/rpcclient/notification/group.go:151:2: return with no blank line before (nlreturn) + return m, nil + ^ +pkg/rpcclient/notification/group.go:162:2: return with no blank line before (nlreturn) + return members[0], nil + ^ +pkg/rpcclient/notification/group.go:171:2: return with no blank line before (nlreturn) + return utils.Slice(members, fn), nil + ^ +pkg/rpcclient/notification/group.go:174:35: func `(*GroupNotificationSender).groupDB2PB` is unused (unused) +func (g *GroupNotificationSender) groupDB2PB(group *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo { + ^ +pkg/rpcclient/notification/group.go:222:2: return with no blank line before (nlreturn) + return result, nil + ^ +pkg/rpcclient/notification/group.go:239:2: `if groupID != ""` has complex nested blocks (complexity: 5) (nestif) + if groupID != "" { + ^ +pkg/rpcclient/notification/group.go:248:12: shadow: declaration of "err" shadows declaration at line 225 (govet) + member, err := g.db.TakeGroupMember(ctx, groupID, userID) + ^ +pkg/rpcclient/notification/group.go:276:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/rpcclient/notification/group.go:289:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupCreatedNotification, tips) + ^ +pkg/rpcclient/notification/group.go:302:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNotification, tips, rpcclient.WithRpcGetUserName()) + ^ +pkg/rpcclient/notification/group.go:315:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNameNotification, tips) + ^ +pkg/rpcclient/notification/group.go:328:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetAnnouncementNotification, tips, rpcclient.WithRpcGetUserName()) + ^ +pkg/rpcclient/notification/group.go:358:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/rpcclient/notification/group.go:373:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), member.GroupID, constant.MemberQuitNotification, tips) + ^ +pkg/rpcclient/notification/group.go:392:5: shadow: declaration of "err" shadows declaration at line 376 (govet) + if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { + ^ +pkg/rpcclient/notification/group.go:401:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/rpcclient/notification/group.go:420:5: shadow: declaration of "err" shadows declaration at line 404 (govet) + if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { + ^ +pkg/rpcclient/notification/group.go:429:2: return with no blank line before (nlreturn) + return nil + ^ +pkg/rpcclient/notification/group.go:452:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupOwnerTransferredNotification, tips) + ^ +pkg/rpcclient/notification/group.go:465:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.MemberKickedNotification, tips) + ^ +pkg/rpcclient/notification/group.go:490:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.MemberInvitedNotification, tips) + ^ +pkg/rpcclient/notification/group.go:509:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.MemberEnterNotification, tips) + ^ +pkg/rpcclient/notification/group.go:522:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupDismissedNotification, tips) + ^ +pkg/rpcclient/notification/group.go:547:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberMutedNotification, tips) + ^ +pkg/rpcclient/notification/group.go:569:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberCancelMutedNotification, tips) + ^ +pkg/rpcclient/notification/group.go:594:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMutedNotification, tips) + ^ +pkg/rpcclient/notification/group.go:619:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupCancelMutedNotification, tips) + ^ +pkg/rpcclient/notification/group.go:641:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberInfoSetNotification, tips) + ^ +pkg/rpcclient/notification/group.go:663:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToAdminNotification, tips) + ^ +pkg/rpcclient/notification/group.go:685:2: return with no blank line before (nlreturn) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToOrdinaryUserNotification, tips) + ^ +pkg/rpcclient/notification/group.go:696:2: return with no blank line before (nlreturn) + return err + ^ +pkg/rpcclient/notification/msg.go:40:2: return with no blank line before (nlreturn) + return m.Notification(ctx, userID, userID, constant.DeleteMsgsNotification, &tips) + ^ +pkg/rpcclient/notification/msg.go:50:2: return with no blank line before (nlreturn) + return m.NotificationWithSesstionType(ctx, sendID, recvID, constant.HasReadReceipt, sesstionType, tips) + ^ +pkg/rpcclient/notification/user.go:55:4: return with no blank line before (nlreturn) + return result, nil + ^ +pkg/rpcclient/notification/user.go:71:2: return with no blank line before (nlreturn) + return f + ^ +pkg/rpcclient/notification/user.go:74:34: func `(*UserNotificationSender).getUsersInfoMap` is unused (unused) +func (u *UserNotificationSender) getUsersInfoMap( + ^ +pkg/rpcclient/notification/user.go:86:2: return with no blank line before (nlreturn) + return result, nil + ^ +pkg/rpcclient/notification/user.go:89:34: func `(*UserNotificationSender).getFromToUserNickname` is unused (unused) +func (u *UserNotificationSender) getFromToUserNickname( + ^ +pkg/rpcclient/notification/user.go:92:20: (*UserNotificationSender).getFromToUserNickname - result 2 (error) is always nil (unparam) +) (string, string, error) { + ^ +pkg/rpcclient/notification/user.go:95:3: error is not nil (line 93) but it returns nil (nilerr) + return "", "", nil + ^ +pkg/rpcclient/notification/user.go:97:2: return with no blank line before (nlreturn) + return users[fromUserID].Nickname, users[toUserID].Nickname, nil + ^ +pkg/rpcclient/push.go:39:2: return with no blank line before (nlreturn) + return &Push{ + ^ +pkg/rpcclient/third.go:45:15: ineffectual assignment to err (ineffassign) + minioClient, err := minioInit() + ^ +pkg/rpcclient/third.go:46:2: return with no blank line before (nlreturn) + return &Third{discov: discov, Client: client, conn: conn, MinioClient: minioClient} + ^ +pkg/rpcclient/third.go:50:2: ineffectual assignment to minioClient (ineffassign) + minioClient := &minio.Client{} + ^ +pkg/rpcclient/third.go:51:2: S1021: should merge variable declaration with assignment on next line (gosimple) + var initUrl string + ^ +pkg/rpcclient/third.go:70:2: return with no blank line before (nlreturn) + return minioClient, nil + ^ +pkg/rpcclient/user.go:48:2: return with no blank line before (nlreturn) + return &User{Discov: discov, Client: client, conn: conn} + ^ +pkg/rpcclient/user.go:57:2: return with no blank line before (nlreturn) + return &rpc + ^ +pkg/rpcclient/user.go:78:2: return with no blank line before (nlreturn) + return resp.UsersInfo, nil + ^ +pkg/rpcclient/user.go:87:2: return with no blank line before (nlreturn) + return users[0], nil + ^ +pkg/rpcclient/user.go:96:2: return with no blank line before (nlreturn) + return utils.SliceToMap(users, func(e *sdkws.UserInfo) string { + ^ +pkg/rpcclient/user.go:111:2: return with no blank line before (nlreturn) + return utils.Slice(users, func(e *sdkws.UserInfo) *sdkws.PublicUserInfo { + ^ +pkg/rpcclient/user.go:127:2: return with no blank line before (nlreturn) + return users[0], nil + ^ +pkg/rpcclient/user.go:140:2: return with no blank line before (nlreturn) + return utils.SliceToMap(users, func(e *sdkws.PublicUserInfo) string { + ^ +pkg/rpcclient/user.go:153:2: return with no blank line before (nlreturn) + return resp.GlobalRecvMsgOpt, nil + ^ +pkg/rpcclient/user.go:162:2: return with no blank line before (nlreturn) + return authverify.CheckAccessV3(ctx, ownerUserID) + ^ +pkg/rpcclient/user.go:171:2: return with no blank line before (nlreturn) + return resp.UserIDs, nil + ^ +pkg/rpcclient/user.go:177:2: return with no blank line before (nlreturn) + return err + ^ +pkg/statistics/statistics.go:39:3: S1000: should use a simple channel send/receive instead of `select` with a single case (gosimple) + select { + ^ +pkg/statistics/statistics.go:69:2: return with no blank line before (nlreturn) + return p + ^