Fix lint issues reported by staticcheck
Used staticcheck 2022.1.2 (v0.3.2) See: staticcheck.io
This commit is contained in:
@@ -444,7 +444,7 @@ func (acc *Account) speed() (bps, current float64) {
|
||||
return 0, 0
|
||||
}
|
||||
// Calculate speed from first read.
|
||||
total := float64(time.Now().Sub(acc.values.start)) / float64(time.Second)
|
||||
total := float64(time.Since(acc.values.start)) / float64(time.Second)
|
||||
if total > 0 {
|
||||
bps = float64(acc.values.bytes) / total
|
||||
} else {
|
||||
|
||||
@@ -111,9 +111,9 @@ func TestStatsGroupOperations(t *testing.T) {
|
||||
runtime.GC()
|
||||
runtime.ReadMemStats(&end)
|
||||
|
||||
t.Log(fmt.Sprintf("%+v\n%+v", start, end))
|
||||
t.Logf("%+v\n%+v", start, end)
|
||||
diff := percentDiff(start.HeapObjects, end.HeapObjects)
|
||||
if diff > 1 || diff < 0 {
|
||||
if diff > 1 {
|
||||
t.Errorf("HeapObjects = %d, expected %d", end.HeapObjects, start.HeapObjects)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user