Run staticcheck on CI (#16170)

This commit is contained in:
Klaus Post
2022-12-05 20:18:50 +01:00
committed by GitHub
parent a9f5b58a01
commit a713aee3d5
24 changed files with 140 additions and 162 deletions

View File

@@ -61,6 +61,7 @@ const (
scannerMetricScanFolder // Scan a folder on disk, recursively.
scannerMetricScanCycle // Full cycle, cluster global
scannerMetricScanBucketDrive // Single bucket on one drive
scannerMetricCompactFolder // Folder compacted.
// Must be last:
scannerMetricLast
@@ -194,7 +195,7 @@ func (p *scannerMetrics) activeDrives() int {
// lifetime returns the lifetime count of the specified metric.
func (p *scannerMetrics) lifetime(m scannerMetric) uint64 {
if m < 0 || m >= scannerMetricLast {
if m >= scannerMetricLast {
return 0
}
val := atomic.LoadUint64(&p.operations[m])
@@ -204,7 +205,7 @@ func (p *scannerMetrics) lifetime(m scannerMetric) uint64 {
// lastMinute returns the last minute statistics of a metric.
// m should be < scannerMetricLastRealtime
func (p *scannerMetrics) lastMinute(m scannerMetric) AccElem {
if m < 0 || m >= scannerMetricLastRealtime {
if m >= scannerMetricLastRealtime {
return AccElem{}
}
val := p.latency[m].total()