From 036581a6c8cd98d0ba1123c136e37c789e400404 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Thu, 8 Jun 2023 15:26:30 +0200 Subject: [PATCH] io.Discard is already handeld by Body.Close() --- requests.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/requests.go b/requests.go index c8619ad..8e362e8 100644 --- a/requests.go +++ b/requests.go @@ -43,12 +43,10 @@ func (c *Client) req(method, path string, body io.Reader, intercept func(*http.R } if redo, err = auth.Verify(c.c, rs, path); err != nil { - io.Copy(io.Discard, rs.Body) rs.Body.Close() return nil, err } if redo { - io.Copy(io.Discard, rs.Body) rs.Body.Close() if body, err = r.GetBody(); err != nil { return nil, err