Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Quick and Clean in Go. Parent comment
You could do:
_ = http.ListenAndServe(*port, nil)
consider: http://play.golang.org/p/o8vLQQmRvp
which would be fixed like: http://play.golang.org/p/DH0j1cwRqW
But yes, since ListenAndServe is normally used to block before main() returns, you could let it fail and terminate. (But you'd probably want to exit with a non-zero value, at least I would).
There are no comments on this comment yet.
You could do:
But why would you? Just omit it entirely. The only time you need to explicitly ignore errors is in multiple returns.consider: http://play.golang.org/p/o8vLQQmRvp
which would be fixed like: http://play.golang.org/p/DH0j1cwRqW
But yes, since ListenAndServe is normally used to block before main() returns, you could let it fail and terminate. (But you'd probably want to exit with a non-zero value, at least I would).