mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 17:45:59 +08:00
fix: fix all lint warning in pkg (#1263)
* fix:fix lint errors in internal * fix:fix lint error in interal/tools * fix: fix lint errros in pkg/statics * fix: fix lint erros in pkg/authverify,pkg/rpcclien * fix: fix lint erros in pkg/common/cmd * fix: fix lint erros in pkg/common/config,convert * fix: fix lint erros in pkg/common/db/cache * fix: fix lint errors in pkg/common/db/controller * fix:fix lint errors in pkg/common/db/relation and pkg/common/db/localcache * fix: fix rest lint errors in pkg/common/db * fix: fix rest lint errors in pkg * fix:set back go.work to use go 1.19
This commit is contained in:
+10
-1
@@ -136,6 +136,7 @@ func NewMessage(discov discoveryregistry.SvcDiscoveryRegistry) *Message {
|
||||
panic(err)
|
||||
}
|
||||
client := msg.NewMsgClient(conn)
|
||||
|
||||
return &Message{discov: discov, conn: conn, Client: client}
|
||||
}
|
||||
|
||||
@@ -147,16 +148,19 @@ func NewMessageRpcClient(discov discoveryregistry.SvcDiscoveryRegistry) MessageR
|
||||
|
||||
func (m *MessageRpcClient) SendMsg(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error) {
|
||||
resp, err := m.Client.SendMsg(ctx, req)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (m *MessageRpcClient) GetMaxSeq(ctx context.Context, req *sdkws.GetMaxSeqReq) (*sdkws.GetMaxSeqResp, error) {
|
||||
resp, err := m.Client.GetMaxSeq(ctx, req)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (m *MessageRpcClient) PullMessageBySeqList(ctx context.Context, req *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error) {
|
||||
resp, err := m.Client.PullMessageBySeqs(ctx, req)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
||||
@@ -165,6 +169,7 @@ func (m *MessageRpcClient) GetConversationMaxSeq(ctx context.Context, conversati
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return resp.MaxSeq, nil
|
||||
}
|
||||
|
||||
@@ -200,6 +205,7 @@ func NewNotificationSender(opts ...NotificationSenderOptions) *NotificationSende
|
||||
for _, opt := range opts {
|
||||
opt(notificationSender)
|
||||
}
|
||||
|
||||
return notificationSender
|
||||
}
|
||||
|
||||
@@ -220,6 +226,7 @@ func (s *NotificationSender) NotificationWithSesstionType(ctx context.Context, s
|
||||
content, err := json.Marshal(&n)
|
||||
if err != nil {
|
||||
log.ZError(ctx, "MsgClient Notification json.Marshal failed", err, "sendID", sendID, "recvID", recvID, "contentType", contentType, "msg", m)
|
||||
|
||||
return err
|
||||
}
|
||||
notificationOpt := ¬ificationOpt{}
|
||||
@@ -229,7 +236,8 @@ func (s *NotificationSender) NotificationWithSesstionType(ctx context.Context, s
|
||||
var req msg.SendMsgReq
|
||||
var msg sdkws.MsgData
|
||||
if notificationOpt.WithRpcGetUsername && s.getUserInfo != nil {
|
||||
userInfo, err := s.getUserInfo(ctx, sendID)
|
||||
var userInfo *sdkws.UserInfo
|
||||
userInfo, err = s.getUserInfo(ctx, sendID)
|
||||
if err != nil {
|
||||
log.ZWarn(ctx, "getUserInfo failed", err, "sendID", sendID)
|
||||
} else {
|
||||
@@ -267,6 +275,7 @@ func (s *NotificationSender) NotificationWithSesstionType(ctx context.Context, s
|
||||
} else {
|
||||
log.ZError(ctx, "MsgClient Notification SendMsg failed", err, "req", &req)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user