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:
CNCSMonster
2023-10-23 16:24:55 +08:00
committed by GitHub
parent ba190fde13
commit b1415473ff
91 changed files with 1617 additions and 855 deletions
+10
View File
@@ -72,6 +72,7 @@ func (m *metaCacheRedis) ExecDel(ctx context.Context) error {
),
)
log.ZWarn(ctx, "delete cache failed, please handle keys", err, "keys", m.keys)
return err
}
retryTimes++
@@ -80,6 +81,7 @@ func (m *metaCacheRedis) ExecDel(ctx context.Context) error {
}
}
}
return nil
}
@@ -103,6 +105,7 @@ func GetDefaultOpt() rockscache.Options {
opts := rockscache.NewDefaultOptions()
opts.StrongConsistency = true
opts.RandomExpireAdjustment = 0.2
return opts
}
@@ -125,6 +128,7 @@ func getCache[T any](
return "", utils.Wrap(err, "")
}
write = true
return string(bs), nil
})
if err != nil {
@@ -139,8 +143,10 @@ func getCache[T any](
err = json.Unmarshal([]byte(v), &t)
if err != nil {
log.ZError(ctx, "cache json.Unmarshal failed", err, "key", key, "value", v, "expire", expire)
return t, utils.Wrap(err, "")
}
return t, nil
}
@@ -169,6 +175,7 @@ func batchGetCache[T any](
}
values[index] = string(bs)
}
return values, nil
})
if err != nil {
@@ -185,6 +192,7 @@ func batchGetCache[T any](
tArrays = append(tArrays, t)
}
}
return tArrays, nil
}
@@ -213,6 +221,7 @@ func batchGetCacheMap[T any](
}
values[index] = string(bs)
}
return values, nil
})
if err != nil {
@@ -229,5 +238,6 @@ func batchGetCacheMap[T any](
tMap[originKeys[i]] = t
}
}
return tMap, nil
}