From: Brad Fitzpatrick Date: Mon, 22 Aug 2016 18:59:20 +0000 (+0000) Subject: net/http: make Transport.CancelRequest doc recommend Request.WithContext X-Git-Tag: go1.8beta1~1723 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=355d7fa8a8c362ee148d3394ce834d0b742c6872;p=gostls13.git net/http: make Transport.CancelRequest doc recommend Request.WithContext The old deprecation docs were referencing another deprecated field. Fixes #16752 Change-Id: I44a690048e00ddc790a80214ecb7f5bb0a5b7b34 Reviewed-on: https://go-review.googlesource.com/27510 Reviewed-by: David Crawshaw --- diff --git a/src/net/http/transport.go b/src/net/http/transport.go index c66623db88..35cee82235 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -494,8 +494,9 @@ func (t *Transport) CloseIdleConnections() { // CancelRequest cancels an in-flight request by closing its connection. // CancelRequest should only be called after RoundTrip has returned. // -// Deprecated: Use Request.Cancel instead. CancelRequest cannot cancel -// HTTP/2 requests. +// Deprecated: Use Request.WithContext to create a request with a +// cancelable context instead. CancelRequest cannot cancel HTTP/2 +// requests. func (t *Transport) CancelRequest(req *Request) { t.reqMu.Lock() cancel := t.reqCanceler[req]