Fix lint errors in modified code in the /pkg directory (#1962)

* /pkg-make lint

Signed-off-by: longyuqing112 <105913803+longyuqing112@users.noreply.github.com>

* /pkg_make_lint

Signed-off-by: longyuqing112 <105913803+longyuqing112@users.noreply.github.com>

---------

Signed-off-by: longyuqing112 <105913803+longyuqing112@users.noreply.github.com>
This commit is contained in:
longyuqing112
2024-02-27 22:12:01 +08:00
committed by GitHub
parent ac8775827d
commit 2becd46bdd
8 changed files with 31 additions and 15 deletions
+7 -6
View File
@@ -192,6 +192,7 @@ func (g *GroupNotificationSender) getGroupOwnerAndAdminUserID(ctx context.Contex
return utils.Slice(members, fn), nil
}
//nolint:unused
func (g *GroupNotificationSender) groupDB2PB(group *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo {
return &sdkws.GroupInfo{
GroupID: group.GroupID,
@@ -231,7 +232,7 @@ func (g *GroupNotificationSender) groupMemberDB2PB(member *relation.GroupMemberM
}
}
func (g *GroupNotificationSender) getUsersInfoMap(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error) {
/* func (g *GroupNotificationSender) getUsersInfoMap(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error) {
users, err := g.getUsersInfo(ctx, userIDs)
if err != nil {
return nil, err
@@ -241,7 +242,7 @@ func (g *GroupNotificationSender) getUsersInfoMap(ctx context.Context, userIDs [
result[user.GetUserID()] = user.(*sdkws.UserInfo)
}
return result, nil
}
} */
func (g *GroupNotificationSender) fillOpUser(ctx context.Context, opUser **sdkws.GroupMemberFullInfo, groupID string) (err error) {
defer log.ZDebug(ctx, "return")
@@ -266,11 +267,11 @@ func (g *GroupNotificationSender) fillOpUser(ctx context.Context, opUser **sdkws
AppMangerLevel: constant.AppAdmin,
}
} else {
member, err := g.db.TakeGroupMember(ctx, groupID, userID)
if err == nil {
member, err2 := g.db.TakeGroupMember(ctx, groupID, userID)
if err2 == nil {
*opUser = g.groupMemberDB2PB(member, 0)
} else if !errs.ErrRecordNotFound.Is(err) {
return err
} else if !errs.ErrRecordNotFound.Is(err2) {
return err2
}
}
}