Re:Exploring Error Handling Patterns in Go
by umanwizard on Thursday August 16, 2018 @11:38AM
(#17775590)
Maybe you would like the concept of "checked exceptions" from Java? Exceptions are part of a method signature and not handling them is a compiler error, but they're still exceptions, not return values.
I liked when I started with Go (mostly due to concurrency primatives, but errors were nice too). In my day job, many of the errors have a need for custom handling and I get that for "free" in Go and I am never surprised by a program crash because I failed to read the docs on a function and what exceptions it may throw (or undocumented exceptions it may throw due to one of its dependencies). I can see right in the signature that I have an error to potentially handle.