mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-09 03:25: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:
Vendored
+17
-12
@@ -59,6 +59,7 @@ func NewFriendCacheRedis(
|
||||
options rockscache.Options,
|
||||
) FriendCache {
|
||||
rcClient := rockscache.NewClient(rdb, options)
|
||||
|
||||
return &FriendCacheRedis{
|
||||
metaCache: NewMetaCacheRedis(rcClient),
|
||||
friendDB: friendDB,
|
||||
@@ -100,14 +101,15 @@ func (f *FriendCacheRedis) GetFriendIDs(ctx context.Context, ownerUserID string)
|
||||
)
|
||||
}
|
||||
|
||||
func (f *FriendCacheRedis) DelFriendIDs(ownerUserID ...string) FriendCache {
|
||||
new := f.NewCache()
|
||||
var keys []string
|
||||
for _, userID := range ownerUserID {
|
||||
func (f *FriendCacheRedis) DelFriendIDs(ownerUserIDs ...string) FriendCache {
|
||||
newGroupCache := f.NewCache()
|
||||
keys := make([]string, 0, len(ownerUserIDs))
|
||||
for _, userID := range ownerUserIDs {
|
||||
keys = append(keys, f.getFriendIDsKey(userID))
|
||||
}
|
||||
new.AddKeys(keys...)
|
||||
return new
|
||||
newGroupCache.AddKeys(keys...)
|
||||
|
||||
return newGroupCache
|
||||
}
|
||||
|
||||
// todo.
|
||||
@@ -128,13 +130,15 @@ func (f *FriendCacheRedis) GetTwoWayFriendIDs(
|
||||
twoWayFriendIDs = append(twoWayFriendIDs, ownerUserID)
|
||||
}
|
||||
}
|
||||
|
||||
return twoWayFriendIDs, nil
|
||||
}
|
||||
|
||||
func (f *FriendCacheRedis) DelTwoWayFriendIDs(ctx context.Context, ownerUserID string) FriendCache {
|
||||
new := f.NewCache()
|
||||
new.AddKeys(f.getTwoWayFriendsIDsKey(ownerUserID))
|
||||
return new
|
||||
newFriendCache := f.NewCache()
|
||||
newFriendCache.AddKeys(f.getTwoWayFriendsIDsKey(ownerUserID))
|
||||
|
||||
return newFriendCache
|
||||
}
|
||||
|
||||
func (f *FriendCacheRedis) GetFriend(
|
||||
@@ -153,7 +157,8 @@ func (f *FriendCacheRedis) GetFriend(
|
||||
}
|
||||
|
||||
func (f *FriendCacheRedis) DelFriend(ownerUserID, friendUserID string) FriendCache {
|
||||
new := f.NewCache()
|
||||
new.AddKeys(f.getFriendKey(ownerUserID, friendUserID))
|
||||
return new
|
||||
newFriendCache := f.NewCache()
|
||||
newFriendCache.AddKeys(f.getFriendKey(ownerUserID, friendUserID))
|
||||
|
||||
return newFriendCache
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user