-
Notifications
You must be signed in to change notification settings - Fork 17
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
Report: bug in TestTeamsClientSend re handling of response error #46
Comments
These 4 contributed lines gave me no end of grief as I went back & forth over existing notes and official documentation. In the end, it was simpler than I was making it out to be. Below are some typed paper notes in case they should prove useful to someone reading this later, perhaps landing here after a search query of some kind. Dave Cheney provides fixes for a Go test to allow the test to complete without unexpected output. This goes back to when Dave's fix was:
But why? The test code creates a new The method signature for So, a new Before Dave's changes, a The To me this means:
Thanks to Dave, the changes (once applied) properly implements Oh, regarding the Go 1.14 vs Go 1.15 behavior, the Go documentation for
It sounds like Go 1.15 does the right thing by setting the |
CHANGES Apply fix provided by @davecheney in order to properly implement the RoundTripper interface's expected behavior: - return response and nil error OR - return nil and a non-nil error to explain failures to obtain a response I likely *over* explained this with doc comments, but I am still very much in "learning" mode here. REFERENCES - GH-46 - 2ce144f - 6db6217 - http://hassansin.github.io/Unit-Testing-http-client-in-Go - golang/go#41071 - golang/go#38095 - golang/go@2d77d33 - golang/go@12d02e7 - https://godoc.org/net/http#RoundTripper - https://godoc.org/net/http#Response - https://godoc.org/net/http#Response.Body
This could be useful for troubleshooting future issues with test results. refs GH-46
This could be useful for troubleshooting future issues with test results. refs GH-46
This could be useful for troubleshooting future issues with test results. refs GH-46
This could be useful for troubleshooting future issues with test results. refs GH-46
Bug report
Dave Cheney's response to a golang/go GH issue I filed:
I confirmed that the
RoundTripper returned a response & error; ignoring response
test output is present all the way back to v1.2.0.References
This project (and original)
Guides
Official/upstream
The text was updated successfully, but these errors were encountered: