diff --git a/methodsallowed/methodsallowed_test.go b/methodsallowed/methodsallowed_test.go index e1872df..b214848 100644 --- a/methodsallowed/methodsallowed_test.go +++ b/methodsallowed/methodsallowed_test.go @@ -52,11 +52,7 @@ func TestAllow(t *testing.T) { allow.ServeHTTP(w, req) resp := w.Result() - t.Cleanup(func() { resp.Body.Close() }) - - t.Cleanup(func() { - resp.Body.Close() - }) + defer resp.Body.Close() body, _ := io.ReadAll(resp.Body)