From b0827d128a59312f2b59ffc0c39ce19c9989ea7a Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Fri, 25 Apr 2025 23:47:08 +0200 Subject: [PATCH] fix(ci): remove gocritic unnecessaryDefer exclusion (#4525) Signed-off-by: Matthieu MOREL --- .golangci.yml | 3 --- repo/blob/filesystem/filesystem_storage_test.go | 2 +- tests/end_to_end_test/restore_test.go | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index ac164fecc..ceca30b43 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -133,9 +133,6 @@ linters: - text: "Magic number: 1e" linters: - mnd - - text: "unnecessaryDefer" - linters: - - gocritic - text: "filepathJoin" linters: - gocritic diff --git a/repo/blob/filesystem/filesystem_storage_test.go b/repo/blob/filesystem/filesystem_storage_test.go index 226f108ec..946e18600 100644 --- a/repo/blob/filesystem/filesystem_storage_test.go +++ b/repo/blob/filesystem/filesystem_storage_test.go @@ -336,7 +336,7 @@ func TestFileStorage_New_MkdirAllFailureIsIgnored(t *testing.T) { }, true) require.NoError(t, err) - defer st.Close(ctx) + st.Close(ctx) } func TestFileStorage_New_ChecksDirectoryExistence(t *testing.T) { diff --git a/tests/end_to_end_test/restore_test.go b/tests/end_to_end_test/restore_test.go index cb699b2a9..a106e7976 100644 --- a/tests/end_to_end_test/restore_test.go +++ b/tests/end_to_end_test/restore_test.go @@ -809,7 +809,7 @@ func verifyValidZipFile(t *testing.T, fname string) { zr, err := zip.OpenReader(fname) require.NoError(t, err) - defer zr.Close() + zr.Close() } func verifyValidTarFile(t *testing.T, fname string) {