Skip to content

net/http: Documentation: type ResponseWriter interface #23124

Closed
@arauter

Description

@arauter

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions