Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: ListenAndServe examples are inconsistent about checking err != nil #12229
The doc comment at http.ListenAndServe says:
whereas other examples in the same package say:
These shorter forms, though pleasingly succinct, rely on the undocumented assumption that if ListenAndServe ever returns, it returns non-nil.
The examples should either always check for nil, or ListenAndServe should document the non-nil postcondition.