aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Gillette <extemporalgenome@gmail.com>2019-08-26 03:30:21 +0000
committerAndrew Bonventre <andybons@golang.org>2019-09-02 21:51:40 +0000
commitb719a5875eecc68df43840f401db6b3c746dff32 (patch)
treed4fa78a14e9c3f7c39918b6c3967671c0bd3fd2c
parentfb7b50c13cecf37873b147efd7ea4c8afce5a688 (diff)
downloadgo-b719a5875eecc68df43840f401db6b3c746dff32.tar.gz
go-b719a5875eecc68df43840f401db6b3c746dff32.zip
[release-branch.go1.13] net/http: make docs refer to Context.Value as a getter instead of context.WithValue
The doc comments of both ServerContextKey and LocalAddrContextKey both suggest that context.WithValue can be used to access (get) properties of the server or connection. This PR fixes those comments to refer to Context.Value instead. Change-Id: I4ed383ef97ba1951f90c555243007469cfc18d4d GitHub-Last-Rev: 05bc3acf82322e3dc77abc7fa0412efe01a77eac GitHub-Pull-Request: golang/go#33833 Reviewed-on: https://go-review.googlesource.com/c/go/+/191838 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 8b03a3992bc755eadbccc10d97adc21d0b229401) Reviewed-on: https://go-review.googlesource.com/c/go/+/191750 Reviewed-by: Andrew Bonventre <andybons@golang.org> Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-rw-r--r--src/net/http/server.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net/http/server.go b/src/net/http/server.go
index 2eb16ff632..f554c81300 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -231,13 +231,13 @@ type CloseNotifier interface {
var (
// ServerContextKey is a context key. It can be used in HTTP
- // handlers with context.WithValue to access the server that
+ // handlers with Context.Value to access the server that
// started the handler. The associated value will be of
// type *Server.
ServerContextKey = &contextKey{"http-server"}
// LocalAddrContextKey is a context key. It can be used in
- // HTTP handlers with context.WithValue to access the local
+ // HTTP handlers with Context.Value to access the local
// address the connection arrived on.
// The associated value will be of type net.Addr.
LocalAddrContextKey = &contextKey{"local-addr"}