update doucmentaiton comment

This commit is contained in:
Ringo Hoffmann 2022-01-28 17:19:52 +01:00
parent 341db84788
commit c42caf78a2
No known key found for this signature in database
GPG Key ID: 5DE1487DA08E34FE

View File

@ -14,6 +14,11 @@ func (c *Client) req(method, path string, body io.Reader, intercept func(*http.R
var retryBuf io.Reader
if body != nil {
// Because Request#Do closes closable streams, Seeker#Seek
// will fail on retry because stream is already closed.
// This inhibits the closing of the passed stream on passing
// it to the RoundTripper and closes the stream after we
// are done with the body content.
if cl, ok := body.(io.Closer); ok {
body = closeInhibitor{body}
defer cl.Close()