Hi all,

I've recently learned about oauth2 and started to convert some of my 
"manual" code using net/http to use an  underlying oauth2.Transport for 
executing authenticated requests and token refresh.

As a result, my application now sometimes shows 

    deprecated: golang.org/x/oauth2: Transport.CancelRequest no longer does 
anything; use contexts

Of course, I'm nowhere calling that method. Digging into the default HTTP 
Client 
(https://github.com/golang/go/blob/a937729c2c2f6950a32bc5cd0f5b88700882f078/src/net/http/client.go)
 
reads:

// For compatibility, the Client will also use the deprecated
// CancelRequest method on Transport if found. New
// RoundTripper implementations should use the Request's Context
// for cancellation instead of implementing CancelRequest.
Timeout time.Duration

I would read this as: if you have an http.Client with an underlying 
oauth2.Transport and the request times out, the oauth2.Transport's 
CancelRequest method will *always* be called and hence show the undesired 
warning.

Is that correct?

Thanks,
Andreas

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0dff84c5-9b62-4d55-8228-28b0367eab72n%40googlegroups.com.

Reply via email to