Skip to content

Commit

Permalink
io.Discard is already handeld by Body.Close()
Browse files Browse the repository at this point in the history
  • Loading branch information
chripo committed Jun 22, 2023
1 parent 11f0c10 commit 036581a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions requests.go
Expand Up @@ -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
Expand Down

0 comments on commit 036581a

Please sign in to comment.