Fix lint issues reported by staticcheck

Used staticcheck 2022.1.2 (v0.3.2)

See: staticcheck.io
This commit is contained in:
albertony 2022-06-08 22:25:17 +02:00
parent 74bd7f3381
commit ec117593f1
66 changed files with 130 additions and 185 deletions

View file

@ -76,10 +76,7 @@ func (m *Memory) CleanChunksByAge(chunkAge time.Duration) {
// CleanChunksByNeed will cleanup chunks after the FS passes a specific chunk
func (m *Memory) CleanChunksByNeed(offset int64) {
var items map[string]cache.Item
items = m.db.Items()
for key := range items {
for key := range m.db.Items() {
sepIdx := strings.LastIndex(key, "-")
keyOffset, err := strconv.ParseInt(key[sepIdx+1:], 10, 64)
if err != nil {