]> Cypherpunks repositories - gostls13.git/commit
net/http: make Request.WithContext documentation less prescriptive
authorDamien Neil <dneil@google.com>
Thu, 16 Jun 2022 20:36:28 +0000 (13:36 -0700)
committerDamien Neil <dneil@google.com>
Mon, 15 Aug 2022 21:54:27 +0000 (21:54 +0000)
commite3c2e4cb7dc006d4282e6d5c85222006d380d701
treedd0a15ae9f832bfb23d184b3e608bc28e609c226
parentde0f4d190fc98c9dcc3d3537ae889be2c5eb7bd5
net/http: make Request.WithContext documentation less prescriptive

WithContext makes a shallow copy of a Request, and Clone makes a
deep copy. Both set the context of the new request. The distinction
between the two is clear, and it doesn't seem useful or necessary
to say that "it's rare to need WithContext".

Also update a couple locations that mention WithContext to mention
Clone as well.

Fixes #53413.

Change-Id: I89e6ddebd7d5ca6573e522fe48cd7f50cc645cdd
Reviewed-on: https://go-review.googlesource.com/c/go/+/412778
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
src/net/http/request.go