Skip to content

doc: Writing web applications ignores error from ListenAndServe #19511

@joneskoo

Description

@joneskoo

@campoy:
Does everyone forget to check the error on ListenAndServe? #golang
https://twitter.com/francesc/status/838547440710012928

Nothing in this tutorial https://golang.org/doc/articles/wiki/ Writing Web Applications, in the Articles section of documentation, seems to indicate that ListenAndServe may return an error. Errors should be checked.

https://golang.org/pkg/net/http/#ListenAndServe
func ListenAndServe(addr string, handler Handler) error
ListenAndServe always returns a non-nil error.

Since I don't see an issue opened by @campoy , I'm opening one.

EDIT: Clarified that the issue is in Article, not the package documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions