|
|
|
|
|
by LinXitoW
378 days ago
|
|
I have to ask, in comparison to what do you like it? Because every functional language, many modern languages like Rust, and even Java with checked exceptions offers this. Hell, you can mostly replicate Gos "error handling" in any language with generics and probably end up with nicer code. If your answer is "JavaScript" or "Python", well, that's the common pattern. |
|
Whereas in Go, the error is visible everywhere. As a developer I see its path more easily since it's always there, and so I have a better mind to handle it right there.
Additionally, it's less easy to group errors together. A try/catch with multiple throwable functions catches an error...which function threw it though? If you want to actually handle an error, I'd prefer handling it from a particular function and not guessing which it came from.
Java with type-checked exceptions is nice. I wish Swift did that a bit better.