3 ms·
The error handling is the single thing that annoys me about Go. If you look at every hello world tutorial, the error return of println is ignored. In language
by rogerbinns 14y ago
The error handling is the single thing that annoys me about Go. If you look at every hello world tutorial, the error return of println is ignored. In languages that use exceptions an error would not be ignored.
A happy medium for me in Go would be if you ignored the error then an implicit "return error" is added at that point. That way errors you handle locally get handled, and those not get passed to the caller. This is somewhat semantically similar to exceptions, but is a lot less code to write. And as a bonus all the hello worlds will have error handling.
(Yes I am aware there are some implementation details.)