-
Notifications
You must be signed in to change notification settings - Fork 33
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
Returning *http.Response to another function is not handled correctly #11
Comments
This also occurs when using a RequestRecorder and calling |
Also occurs if you ever have a function that harmlessly passes through an HTTP response, func addHeader(resp *http.Response) *http.Response {
resp.Header.Set("foo", "bar")
return resp
} (clearly you don't even need to return the pointer, really, but that's beside the point, this is an actual example I've seen in the wild) |
This also occurs when returning a function that takes response as an argument, as in the following. func modifyResponse() func(*http.Response) error {
return func(resp *http.Response) error {
return nil
}
} response body must be closed (bodyclose)
proxy.go:38:40: proxy.ModifyResponse = modifyResponse() |
Here is the sample code to reproduce:
And the result of go vet:
The text was updated successfully, but these errors were encountered: