You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mikioh
changed the title
http.ListenAndServe examples are inconsistent about checking err != nil
net/http: ListenAndServe examples are inconsistent about checking err != nil
Aug 21, 2015
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.
The text was updated successfully, but these errors were encountered: