Thats what I think too. Thanks for the confirmation, I'll raise a pull request with the aforementioned third-party package.
Thanks everyone. On Monday, December 12, 2016 at 10:25:10 AM UTC, Dave Cheney wrote: > > I don't think it's up to the std lib to define such an interface; that > should be the responsibility of the third party package -- it should define > an interface with the behaviour it requires > > On Monday, 12 December 2016 20:55:26 UTC+11, omarsharif...@gmail.com > wrote: >> >> Yeah, I thought as much. >> >> I will raise a pull request with the third-party package and implement >> the requirement of a http.Client as an interface that matches the >> http.Client methods used by the package. >> >> Should the standard library http.Client provide an interface for >> http.Client so that third-party packages can accept that instead of the >> concrete stdlib http.Client, or is it the communities opinion that >> third-party packages should create an interface they accept, which covers >> the methods they call? >> >> Cheers, >> Ben >> >> On Sunday, December 11, 2016 at 7:59:12 PM UTC, Kevin Conway wrote: >>> >>> > How would I swap out a http.Client that is required by a third-party >>> library with a another that supports, say retries with exponential back-off? >>> I'd suggest looking at http.Transport and http.RoundTripper [ >>> https://golang.org/pkg/net/http/#RoundTripper]. The docs explicitly >>> forbid using RoundTripper to implement higher level protocol features like >>> retry-with-backoff based on HTTP response codes, but those are your only >>> hooks into making this a feature of the client rather than moving the retry >>> logic somewhere else. >>> >>> >>> On Sun, Dec 11, 2016 at 4:07 AM <omarsharif...@gmail.com> wrote: >>> >>>> Just a quick question - I've noticed that the http package doesn't have >>>> an interface for Client. How would I swap out a http.Client that is >>>> required by a third-party library with a another that supports, say >>>> retries >>>> with exponential back-off? It appears that it is not possible? Would the >>>> http package benefit from an interface for the http.Client? >>>> >>>> Cheers! >>>> Ben >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "golang-nuts" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to golang-nuts...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.