mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net/http: document that Request.Clone does not deep copy Body
Fixes #36095 Change-Id: I94ae014b0ee45b4aeb38cb247e42cfc13f663ded Reviewed-on: https://go-review.googlesource.com/c/go/+/593175 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
This commit is contained in:
parent
cf54a3d114
commit
29b1a6765f
1 changed files with 2 additions and 0 deletions
|
|
@ -377,6 +377,8 @@ func (r *Request) WithContext(ctx context.Context) *Request {
|
|||
// Clone returns a deep copy of r with its context changed to ctx.
|
||||
// The provided ctx must be non-nil.
|
||||
//
|
||||
// Clone only makes a shallow copy of the Body field.
|
||||
//
|
||||
// For an 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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue