From 9139089ee5d3e0724157ca79e7cc2f23a0c750a7 Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Sat, 13 Jun 2015 11:25:17 -0400 Subject: [PATCH] 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 --- src/net/http/request.go | 1 + src/net/http/response.go | 2 ++ 2 files changed, 3 insertions(+) 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, -- 2.50.0