Commit 6f12826a authored by Brad Fitzpatrick's avatar Brad Fitzpatrick Committed by Chris Broadfoot

[release-branch.go1.7] 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/27510Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
Reviewed-on: https://go-review.googlesource.com/28638Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 3129c67d
......@@ -498,8 +498,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]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment