Use Error instead of Errorf

If the string formatting is not required
use Error.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2020-03-30 10:34:13 +05:30 committed by mergify[bot]
parent b1dfcb4d7e
commit 84aa1ba392
2 changed files with 3 additions and 3 deletions

View File

@ -157,7 +157,7 @@ func TestConnPool(t *testing.T) {
// force expiring the ConnEntry by fetching it and adjusting .lastUsed // force expiring the ConnEntry by fetching it and adjusting .lastUsed
ce, exists := cp.conns[unique] ce, exists := cp.conns[unique]
if !exists { if !exists {
t.Errorf("getting the conn from cp.conns failed") t.Error("getting the conn from cp.conns failed")
} }
ce.lastUsed = ce.lastUsed.Add(-2 * expiry) ce.lastUsed = ce.lastUsed.Add(-2 * expiry)

View File

@ -29,13 +29,13 @@ func TestGetPIDLimix(t *testing.T) {
t.Errorf("no error should be returned, got: %v", err) t.Errorf("no error should be returned, got: %v", err)
} }
if limit == 0 { if limit == 0 {
t.Errorf("a PID limit of 0 is invalid") t.Error("a PID limit of 0 is invalid")
} }
// this is expected to fail when not run as root // this is expected to fail when not run as root
err = SetPIDLimit(4096) err = SetPIDLimit(4096)
if err != nil { if err != nil {
t.Logf("failed to set PID limit, are you running as root?") t.Log("failed to set PID limit, are you running as root?")
} else { } else {
// in case it worked, reset to the previous value // in case it worked, reset to the previous value
err = SetPIDLimit(limit) err = SetPIDLimit(limit)