diff --git a/internal/profiler/profiler_test.go b/internal/profiler/profiler_test.go index 3ad8356c..4df89d10 100644 --- a/internal/profiler/profiler_test.go +++ b/internal/profiler/profiler_test.go @@ -11,8 +11,6 @@ import ( ) func TestNew(t *testing.T) { - const argName = "pass" - const pass = "qwe" td := testdeep.NewT(t) profiler := New(zap.NewNop(), Config{AllowedNetworks: []string{"127.0.0.1/32", "::1/128"}}) td.Len(profiler.secretHandler.AllowedNetworks, 2) @@ -21,8 +19,6 @@ func TestNew(t *testing.T) { } func TestProfiler_ServeHTTP(t *testing.T) { - const argName = "pass" - const pass = "qwe" td := testdeep.NewT(t) profiler := New(zap.NewNop(), Config{AllowedNetworks: []string{"127.0.0.1/32", "::1/128"}}) @@ -34,4 +30,5 @@ func TestProfiler_ServeHTTP(t *testing.T) { resp := respWriter.Result() td.Cmp(resp.StatusCode, http.StatusOK) td.True(strings.Contains(resp.Header.Get("content-type"), "text/html")) + _ = resp.Body.Close() } diff --git a/internal/profiler/secret_handler_test.go b/internal/profiler/secret_handler_test.go index f098a41a..5ab9b528 100644 --- a/internal/profiler/secret_handler_test.go +++ b/internal/profiler/secret_handler_test.go @@ -45,6 +45,7 @@ func TestSecretHandler_ServeHTTP(t *testing.T) { resp := respWriter.Result() td.Cmp(resp.StatusCode, http.StatusOK) td.True(nextCalled) + _ = resp.Body.Close() nextCalled = false respWriter = httptest.NewRecorder() @@ -56,6 +57,7 @@ func TestSecretHandler_ServeHTTP(t *testing.T) { td.Cmp(resp.StatusCode, http.StatusForbidden) td.False(nextCalled) nextCalled = false + _ = resp.Body.Close() nextCalled = false respWriter = httptest.NewRecorder() @@ -67,4 +69,5 @@ func TestSecretHandler_ServeHTTP(t *testing.T) { td.Cmp(resp.StatusCode, http.StatusInternalServerError) td.False(nextCalled) nextCalled = false + _ = resp.Body.Close() }