From 84aa1ba392a7f9ce5123b9a3d3d6815f52633cf3 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 30 Mar 2020 10:34:13 +0530 Subject: [PATCH] Use Error instead of Errorf If the string formatting is not required use Error. Signed-off-by: Madhu Rajanna --- pkg/util/conn_pool_test.go | 2 +- pkg/util/pidlimit_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/util/conn_pool_test.go b/pkg/util/conn_pool_test.go index 72af5b8b0..c32bc193c 100644 --- a/pkg/util/conn_pool_test.go +++ b/pkg/util/conn_pool_test.go @@ -157,7 +157,7 @@ func TestConnPool(t *testing.T) { // force expiring the ConnEntry by fetching it and adjusting .lastUsed ce, exists := cp.conns[unique] 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) diff --git a/pkg/util/pidlimit_test.go b/pkg/util/pidlimit_test.go index 6fd06f32c..787aae31c 100644 --- a/pkg/util/pidlimit_test.go +++ b/pkg/util/pidlimit_test.go @@ -29,13 +29,13 @@ func TestGetPIDLimix(t *testing.T) { t.Errorf("no error should be returned, got: %v", err) } 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 err = SetPIDLimit(4096) 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 { // in case it worked, reset to the previous value err = SetPIDLimit(limit)