diff --git a/github/github.go b/github/github.go index f3eadce9e9..258145a954 100644 --- a/github/github.go +++ b/github/github.go @@ -477,12 +477,7 @@ func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Res return nil, err } - - defer func() { - // Drain up to 512 bytes and close the body to let the Transport reuse the connection - io.CopyN(ioutil.Discard, resp.Body, 512) - resp.Body.Close() - }() + defer resp.Body.Close() response := newResponse(resp)