From bb2f56a29d83fb3a42ba76c0558ca418ad34c16a Mon Sep 17 00:00:00 2001 From: Dmitry Zenovich Date: Fri, 11 Oct 2024 20:01:32 +0300 Subject: [PATCH] do not close the response body in iSendrequestGeneric as it is closed inside SendTestHTTPRequest() --- testhelpers/steps_request.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testhelpers/steps_request.go b/testhelpers/steps_request.go index 82481c0aa..2f0d01e3e 100644 --- a/testhelpers/steps_request.go +++ b/testhelpers/steps_request.go @@ -68,9 +68,8 @@ func (ctx *TestContext) iSendrequestGeneric(method, path, reqBody string) error return err } - // do request + //nolint:bodyclose // the body is closed in SendTestHTTPRequest response, body, err := SendTestHTTPRequest(testServer, method, path, headers, strings.NewReader(reqBody)) - defer func() { _ = response.Body.Close() }() if err != nil { return err }