Removed warnings from go staticcheck

This commit is contained in:
gezimbll
2023-11-03 12:20:48 -04:00
committed by Dan Christian Bogos
parent 529430bd4d
commit c2dacc42c1
97 changed files with 334 additions and 761 deletions

View File

@@ -49,7 +49,7 @@ func TestGuardianMultipleKeys(t *testing.T) {
}
sg.Wait()
mustExecDur := time.Duration(maxIter*100) * time.Millisecond
if execTime := time.Now().Sub(tStart); execTime < mustExecDur ||
if execTime := time.Since(tStart); execTime < mustExecDur ||
execTime > mustExecDur+100*time.Millisecond {
t.Errorf("Execution took: %v", execTime)
}
@@ -78,7 +78,7 @@ func TestGuardianTimeout(t *testing.T) {
}
sg.Wait()
mustExecDur := time.Duration(maxIter*10) * time.Millisecond
if execTime := time.Now().Sub(tStart); execTime < mustExecDur ||
if execTime := time.Since(tStart); execTime < mustExecDur ||
execTime > mustExecDur+100*time.Millisecond {
t.Errorf("Execution took: %v", execTime)
}
@@ -155,7 +155,7 @@ func TestGuardianGuardIDs(t *testing.T) {
// test lock without timer
refID := Guardian.GuardIDs("", 0, lockIDs...)
if totalLockDur := time.Now().Sub(tStart); totalLockDur < lockDur {
if totalLockDur := time.Since(tStart); totalLockDur < lockDur {
t.Errorf("Lock duration too small")
}
time.Sleep(30 * time.Millisecond)