From: Christoph Hack Date: Thu, 19 Jan 2012 14:11:02 +0000 (-0800) Subject: net/http: the documentation should call NewRequest with the right signature. X-Git-Tag: weekly.2012-01-20~24 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2a6b4e120a6f67d532f698f238547690bc18efba;p=gostls13.git net/http: the documentation should call NewRequest with the right signature. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5554063 --- diff --git a/src/pkg/net/http/doc.go b/src/pkg/net/http/doc.go index 2dbcf8dc97..8962ed31e6 100644 --- a/src/pkg/net/http/doc.go +++ b/src/pkg/net/http/doc.go @@ -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) // ...