Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: Documentation: type ResponseWriter interface #23124

Closed
arauter opened this issue Dec 13, 2017 · 1 comment
Closed

net/http: Documentation: type ResponseWriter interface #23124

arauter opened this issue Dec 13, 2017 · 1 comment

Comments

@arauter
Copy link

arauter commented Dec 13, 2017

I have found a small error in the type ResponseWriter interface documentation. As part of the server.go file the following is stated:

// To suppress implicit response headers (such as "Date"), set
// their value to nil.
Header() Header

However, Header is of type type Header map[string][]string which means headers can only be overritten using the empty string "". To avoid any confusion, the documentation should hence be changed accordingly:

// To suppress implicit response headers (such as "Date"), set
// their value to "" (empty string).
Header() Header
@bradfitz
Copy link
Contributor

The docs are correct.

See https://play.golang.org/p/0FhjACxj0C

@mikioh mikioh changed the title Documentation: type ResponseWriter interface net/http: Documentation: type ResponseWriter interface Jan 5, 2018
@golang golang locked and limited conversation to collaborators Jan 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants