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
{{ message }}
Repository navigation
doc: Writing web applications ignores error from ListenAndServe #19511
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.
The documentation pointed by @joneskoo is indeed failing silently if http.ListenAndServe returns an error.
Since we're not using the Shutdown method, I'd say that it's safe to simply add log.Fatal.
I'll send a CL
Activity
qqiao commentedon Mar 12, 2017
The error isn't ignored in the example. It was first logged, then caused an os.Exit(1)
https://golang.org/src/log/log.go?s=9066:9094#L291
ianlancetaylor commentedon Aug 3, 2017
Ping @campoy
campoy commentedon Aug 3, 2017
The documentation pointed by @joneskoo is indeed failing silently if
http.ListenAndServereturns an error.Since we're not using the
Shutdownmethod, I'd say that it's safe to simply addlog.Fatal.I'll send a CL
gopherbot commentedon Aug 3, 2017
Change https://golang.org/cl/53071 mentions this issue:
docs: add error handling on http.ListenAndServe