From ee117713230930c85b34dc32d452443424eb2933 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 17 Jun 2022 03:55:52 -0400 Subject: [PATCH] fix: add response closures to web_test.go (#10675) * fix: add response closures to web_test.go Signed-off-by: mtfoley --- web/web_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/web_test.go b/web/web_test.go index 102b30a15..65935079c 100644 --- a/web/web_test.go +++ b/web/web_test.go @@ -566,6 +566,9 @@ func TestAgentAPIEndPoints(t *testing.T) { resp, err := http.DefaultClient.Do(req) require.NoError(t, err) require.Equal(t, http.StatusUnprocessableEntity, resp.StatusCode) + t.Cleanup(func() { + require.NoError(t, resp.Body.Close()) + }) } } @@ -584,6 +587,9 @@ func TestAgentAPIEndPoints(t *testing.T) { resp, err := http.DefaultClient.Do(req) require.NoError(t, err) require.Equal(t, http.StatusOK, resp.StatusCode) + t.Cleanup(func() { + require.NoError(t, resp.Body.Close()) + }) } } }