diff --git a/pkg/fileutil/fileutil_test.go b/pkg/fileutil/fileutil_test.go index bb2db2a21..89d511cbc 100644 --- a/pkg/fileutil/fileutil_test.go +++ b/pkg/fileutil/fileutil_test.go @@ -52,7 +52,7 @@ func TestReadDir(t *testing.T) { if err != nil { t.Fatalf("error creating file: %v", err) } - if err := fh.Close(); err != nil { + if err = fh.Close(); err != nil { t.Fatalf("error closing file: %v", err) } } diff --git a/pkg/fileutil/lock_test.go b/pkg/fileutil/lock_test.go index cda47deea..cecf12988 100644 --- a/pkg/fileutil/lock_test.go +++ b/pkg/fileutil/lock_test.go @@ -28,7 +28,7 @@ func TestLockAndUnlock(t *testing.T) { } f.Close() defer func() { - err := os.Remove(f.Name()) + err = os.Remove(f.Name()) if err != nil { t.Fatal(err) } diff --git a/pkg/fileutil/purge_test.go b/pkg/fileutil/purge_test.go index 1b0fc21b1..b11a4b05f 100644 --- a/pkg/fileutil/purge_test.go +++ b/pkg/fileutil/purge_test.go @@ -121,7 +121,7 @@ func TestPurgeFileHoldingLock(t *testing.T) { } select { - case err := <-errch: + case err = <-errch: t.Errorf("unexpected purge error %v", err) case <-time.After(time.Millisecond): }