From: Matt Layher Date: Sat, 13 Jun 2015 15:25:17 +0000 (-0400) Subject: net/http: add comment to exported ErrNoCookie and ErrNoLocation values X-Git-Tag: go1.5beta1~102 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9139089ee5d3e0724157ca79e7cc2f23a0c750a7;p=gostls13.git net/http: add comment to exported ErrNoCookie and ErrNoLocation values All other exported errors in net/http are commented. This change adds documentation to ErrNoCookie and ErrNoLocation to explain where they are returned, and why. Change-Id: I21fa0d070dd35256681ad0714000f238477d4af1 Reviewed-on: https://go-review.googlesource.com/11044 Reviewed-by: Russ Cox --- diff --git a/src/net/http/request.go b/src/net/http/request.go index 08d1230df1..353323c410 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -243,6 +243,7 @@ func (r *Request) Cookies() []*Cookie { return readCookies(r.Header, "") } +// ErrNoCookie is returned by Request's Cookie method when a cookie is not found. var ErrNoCookie = errors.New("http: named cookie not present") // Cookie returns the named cookie provided in the request or diff --git a/src/net/http/response.go b/src/net/http/response.go index 4afecda130..76b8538524 100644 --- a/src/net/http/response.go +++ b/src/net/http/response.go @@ -93,6 +93,8 @@ func (r *Response) Cookies() []*Cookie { return readSetCookies(r.Header) } +// ErrNoLocation is returned by Response's Location method +// when no Location header is present. var ErrNoLocation = errors.New("http: no Location header in response") // Location returns the URL of the response's "Location" header,