Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 93559f4

Browse files
hoozecnjoanlopezinkel
authored
fix connection leak (#162)
* fix connection leak * Apply suggestions from code review --------- Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com> Co-authored-by: Leandro López <inkel.ar@gmail.com>
1 parent 393a4f4 commit 93559f4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

client.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ func (c *Client) request(method, requestPath string, query url.Values, body []by
111111
continue
112112
}
113113

114-
defer resp.Body.Close()
115-
116114
// read the body (even on non-successful HTTP status codes), as that's what the unit tests expect
117115
bodyContents, err = ioutil.ReadAll(resp.Body)
116+
resp.Body.Close() //nolint:errcheck
118117

119118
// if there was an error reading the body, try again
120119
if err != nil {

0 commit comments

Comments
 (0)