Closed
Description
The doc comment at http.ListenAndServe says:
err := http.ListenAndServe(":12345", nil)
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
whereas other examples in the same package say:
log.Fatal(http.ListenAndServe(":12345", nil))
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.