]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: add comment to exported ErrNoCookie and ErrNoLocation values
authorMatt Layher <mdlayher@gmail.com>
Sat, 13 Jun 2015 15:25:17 +0000 (11:25 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 26 Jun 2015 17:28:07 +0000 (17:28 +0000)
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 <rsc@golang.org>
src/net/http/request.go
src/net/http/response.go

index 08d1230df1ae1dfe495fbaee50b461d40663530b..353323c4107f716dc0cfe480fa3aee9d5fdf727a 100644 (file)
@@ -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
index 4afecda130ed4a72620b5c734b8d104843739655..76b8538524476560e282a172d87ffb7ebfd61f5b 100644 (file)
@@ -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,