Skip to content

Conversation

@brenol
Copy link
Contributor

@brenol brenol commented Oct 18, 2020

As mentioned in Do docs:

// If the returned error is nil, the Response will contain a non-nil
// Body which the user is expected to close. If the Body is not both
// read to EOF and closed, the Client's underlying RoundTripper
// (typically Transport) may not be able to re-use a persistent TCP
// connection to the server for a subsequent "keep-alive" request.

I also thought of changing from your custom HttpClient interface to the default http.RoundTripper interface. What do you think?

@TwiN
Copy link
Owner

TwiN commented Oct 18, 2020

I also thought of changing from your custom HttpClient interface to the default http.RoundTripper interface. What do you think?
@brenol The only reason I'm using a custom HttpClient is so I can mock it. As long as the change you're suggesting doesn't affect the ability to mock responses, I'm fine with it.

Thank you for the contribution!

@TwiN TwiN merged commit 5bef116 into TwiN:master Oct 18, 2020
@TwiN
Copy link
Owner

TwiN commented Oct 19, 2020

Released in v0.0.2

TwiN pushed a commit that referenced this pull request Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants