diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2018-08-13 16:00:34 +0000 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-08-13 18:28:09 +0000 |
commit | 7a6fc1f30bc7339726cd3f93f96be3e0d36ff7cb (patch) | |
tree | f7a9ff26f3886c189897f7dcdda44b0ab89b0501 /src/net/http/request.go | |
parent | 015873c15348628ee871af7ab8f79c941870d6e2 (diff) | |
download | go-7a6fc1f30bc7339726cd3f93f96be3e0d36ff7cb.tar.gz go-7a6fc1f30bc7339726cd3f93f96be3e0d36ff7cb.zip |
net/http: update request cancelation docs
Fixes #26101
Change-Id: Id4def032b846257d2de992b7561ac90a17e08b91
Reviewed-on: https://go-review.googlesource.com/129155
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Diffstat (limited to 'src/net/http/request.go')
-rw-r--r-- | src/net/http/request.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/net/http/request.go b/src/net/http/request.go index 8cb278ea2c..a40b0a3cb8 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -339,6 +339,10 @@ func (r *Request) Context() context.Context { // WithContext returns a shallow copy of r with its context changed // to ctx. The provided ctx must be non-nil. +// +// For outgoing client request, the context controls the entire +// lifetime of a request and its response: obtaining a connection, +// sending the request, and reading the response headers and body. func (r *Request) WithContext(ctx context.Context) *Request { if ctx == nil { panic("nil context") |