diff options
author | Vladimir Shushlin <v.shushlin@gmail.com> | 2021-12-06 16:24:20 +0300 |
---|---|---|
committer | Vladimir Shushlin <v.shushlin@gmail.com> | 2021-12-07 12:07:31 +0300 |
commit | 0ab62643e5b61daf82ecf5a2c1ed196796059514 (patch) | |
tree | 87c3aad7e854a40b86ca1c0578d20135965cddd4 /test/acceptance/zip_test.go | |
parent | d228c13c76d11091f8514e40940dc7df1b633e5a (diff) |
refactor: enable unparam in .golangci.yml
and fix offences
Diffstat (limited to 'test/acceptance/zip_test.go')
-rw-r--r-- | test/acceptance/zip_test.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test/acceptance/zip_test.go b/test/acceptance/zip_test.go index f7623340..fcaecf25 100644 --- a/test/acceptance/zip_test.go +++ b/test/acceptance/zip_test.go @@ -12,8 +12,7 @@ import ( ) func TestZipServing(t *testing.T) { - _, cleanup := newZipFileServerURL(t, "../../shared/pages/group/zip.gitlab.io/public.zip") - defer cleanup() + runObjectStorage(t, "../../shared/pages/group/zip.gitlab.io/public.zip") RunPagesProcess(t, withListeners([]ListenSpec{httpListener}), @@ -98,8 +97,7 @@ func TestZipServing(t *testing.T) { } func TestZipServingCache(t *testing.T) { - _, cleanup := newZipFileServerURL(t, "../../shared/pages/group/zip.gitlab.io/public.zip") - t.Cleanup(cleanup) + runObjectStorage(t, "../../shared/pages/group/zip.gitlab.io/public.zip") RunPagesProcess(t, withListeners([]ListenSpec{httpListener}), @@ -246,7 +244,7 @@ func TestZipServingConfigShortTimeout(t *testing.T) { require.Equal(t, http.StatusInternalServerError, response.StatusCode, "should fail to serve") } -func newZipFileServerURL(t *testing.T, zipFilePath string) (string, func()) { +func runObjectStorage(t *testing.T, zipFilePath string) { t.Helper() m := http.NewServeMux() @@ -271,8 +269,8 @@ func newZipFileServerURL(t *testing.T, zipFilePath string) (string, func()) { // Start the server. testServer.Start() - return testServer.URL, func() { + t.Cleanup(func() { // Cleanup. testServer.Close() - } + }) } |