New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: rogue log output to stderr in net/http package #46067
Comments
output is 2021/05/09 17:46:09 RoundTripper returned a response & error; ignoring response from Line 255 in 5203357
|
The logging is correct. It is letting you know that you violated the RoundTripper contract.
|
Connected to golang/go#46067
Connected to golang/go#46067
Thanks @fraenkel. That provides helpful advice how to resolve that in my tests. I didn't realize logging was generally recommended in packages. Thanks for the feedback. Should I close this issue? |
It isn't but there is little else one can do here. Given no error can be returned which would also be rude, a panic is just as bad. The logging was sufficient for you to notice which is its intent. |
Yeah, I still think logging is the best compromise there. It's helpful but not too intrusive, but enough to get noticed. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What did you do?
What did you expect to see?
Expecting an response or error to handle, or something else? (This looks like a developer's note to self, not necessarily something for everyone?)
What did you see instead?
Seeing an output to
stderr
which I don't think we are expected to work with. It seems like this would be more idiomatic for the caller to deal with this somewhere, and not have the package itself output anything. I'd be interested to hear more about the intentions of the authorship though.The text was updated successfully, but these errors were encountered: