]> Cypherpunks repositories - gostls13.git/commitdiff
doc: change variable name in Effective Go
authorVitor De Mario <vitordemario@gmail.com>
Thu, 15 Sep 2016 23:46:20 +0000 (20:46 -0300)
committerRob Pike <r@golang.org>
Fri, 16 Sep 2016 01:10:51 +0000 (01:10 +0000)
Effective Go has references to a function call f(c, req) made by ServeHTTP mixed with f(w,
req). c is dropped in favor of w to maintain consistency

Fixes #17128

Change-Id: I6746fd115ed5a58971fd24e54024d29d18ead1fa
Reviewed-on: https://go-review.googlesource.com/29311
Reviewed-by: Rob Pike <r@golang.org>
doc/effective_go.html

index f6fe48c8d0465b4892b6c38863825e4976177270..e07c27ca2fffa2fd788f1422bc5895089687f8b9 100644 (file)
@@ -2409,7 +2409,7 @@ The <code>http</code> package contains this code:
 // Handler object that calls f.
 type HandlerFunc func(ResponseWriter, *Request)
 
-// ServeHTTP calls f(c, req).
+// ServeHTTP calls f(w, req).
 func (f HandlerFunc) ServeHTTP(w ResponseWriter, req *Request) {
     f(w, req)
 }
@@ -2447,7 +2447,7 @@ the handler installed at that page has value <code>ArgServer</code>
 and type <code>HandlerFunc</code>.
 The HTTP server will invoke the method <code>ServeHTTP</code>
 of that type, with <code>ArgServer</code> as the receiver, which will in turn call
-<code>ArgServer</code> (via the invocation <code>f(c, req)</code>
+<code>ArgServer</code> (via the invocation <code>f(w, req)</code>
 inside <code>HandlerFunc.ServeHTTP</code>).
 The arguments will then be displayed.
 </p>