Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: RoundTripper behavour change #10918
Change in question: e1d9fcd#diff-91f5f51987ce03a73a7d2e8b701f84e9R142
I realize that the functionality of RoundTripper was poorly defined. I tried asking several times on the gonuts forum as well as stackoverflow as to its intention, and how it should be used. With this change however, it now breaks some functionality I had in a previous version of Go.
I unfortunately have to deal with SOAP APIs quite frequently. So I use a custom RoundTripper that parses the response body for the fault and returns a new error type specific to a soap fault. While I know this goes against what was then slightly documented (http://golang.org/pkg/net/http/#RoundTripper), I'm note sure I'm sold that this restriction of resp == nil when error != should be enforced, as it was not before.
You don't clarify which versions of Go.
Specify which version of Go you used before and in which version the behavior changed.
But I suspect you're talking about things <= Go 1.4, in which case the ship has sailed.
I'm also not just what SOAP has to do with this bug.
Ideally I would like to create a wrapper to http.Client. However there is not a Client interface in the standard library. Due to this, APIs have to request a pointer to an http.Client struct, which makes it impossible to wrap a http.Client and satisfy that dependency in third party APIs.
Are there an discussions around this, perhaps? I'd like to try to get this in to discussions for Go 2 if possible.