From e117b5e75a831add666700f3040c3c65a0a33ddc Mon Sep 17 00:00:00 2001 From: Ben Sarmiento Date: Mon, 22 Jan 2024 23:23:55 +0100 Subject: [PATCH] Remove body close --- pkg/http/client.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/http/client.go b/pkg/http/client.go index 005aa64..bd9682f 100644 --- a/pkg/http/client.go +++ b/pkg/http/client.go @@ -181,9 +181,6 @@ func (r *HTTPClient) Do(req *http.Request) (*http.Response, error) { attempt := 0 for { resp, err = r.client.Do(req) - if err != nil { - defer resp.Body.Close() - } if resp != nil && (resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent) { body, _ := io.ReadAll(resp.Body) if body != nil {