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
SickAustrian opened this issue Dec 13, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@SickAustrian
Copy link

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

This comment has been minimized.

Copy link
Member

commented Dec 13, 2017

The docs are correct.

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

@bradfitz bradfitz closed this Dec 13, 2017

@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.
You can’t perform that action at this time.