]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: the documentation should call NewRequest with the right signature.
authorChristoph Hack <christoph@tux21b.org>
Thu, 19 Jan 2012 14:11:02 +0000 (06:11 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 19 Jan 2012 14:11:02 +0000 (06:11 -0800)
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5554063

src/pkg/net/http/doc.go

index 2dbcf8dc97c8e0ef3b69e438a35eddd81ee680e2..8962ed31e6a31b36fa0d79e9c666314a13bd4203 100644 (file)
@@ -34,7 +34,8 @@ settings, create a Client:
        resp, err := client.Get("http://example.com")
        // ...
 
-       req := http.NewRequest("GET", "http://example.com", nil)
+       req, err := http.NewRequest("GET", "http://example.com", nil)
+       // ...
        req.Header.Add("If-None-Match", `W/"wyzzy"`)
        resp, err := client.Do(req)
        // ...