Skip to content

Commit 1585603

Browse files
authored
Merge pull request #202 from cli/babakks/explain-resp-body-close
docs(pkg/api): explain `HandleHTTPError` does not close response body
2 parents 41e1e0d + ec8f5ca commit 1585603

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pkg/api/errors.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ func matchPath(p, expect string) bool {
9898
}
9999

100100
// HandleHTTPError parses a http.Response into a HTTPError.
101+
//
102+
// The function attempts to read the response's body, but it does not close it.
101103
func HandleHTTPError(resp *http.Response) error {
102104
httpError := &HTTPError{
103105
Headers: resp.Header,

0 commit comments

Comments
 (0)