tests: Do not allow forced type asserts (#20905)

This commit is contained in:
Klaus Post
2025-02-18 08:25:55 -08:00
committed by GitHub
parent aeabac9181
commit 90f5e1e5f6
100 changed files with 371 additions and 358 deletions

View File

@@ -127,7 +127,6 @@ func (m *Monitor) getReport(selectBucket SelectionFunction) *BucketBandwidthRepo
}
}
m.tlock.RUnlock()
}
return report
}

View File

@@ -64,7 +64,6 @@ func (r *MonitoredReader) Read(buf []byte) (n int, err error) {
r.opts.HeaderSize = 0
need = int(math.Min(float64(b-hdr), float64(need))) // use remaining tokens towards payload
tokens = need + hdr
} else { // part of header can be accommodated
r.opts.HeaderSize -= b - 1
need = 1 // to ensure we read at least one byte for every Read

View File

@@ -207,7 +207,6 @@ func (lc Lifecycle) HasActiveRules(prefix string) bool {
if !rule.Transition.IsNull() { // this allows for Transition.Days to be zero.
return true
}
}
return false
}

View File

@@ -365,7 +365,6 @@ func TestHasActiveRules(t *testing.T) {
t.Fatalf("Expected result with recursive set to true: `%v`, got: `%v`", tc.expectedRec, got)
}
})
}
}

View File

@@ -67,6 +67,5 @@ func TestMetadataReplicate(t *testing.T) {
t.Fatalf("Expected result with recursive set to false: `%v`, got: `%v`", tc.expectedResult, got)
}
})
}
}