|
|
|
|
|
by swagonomixxx
1843 days ago
|
|
I don't think I like any of these proposals. None of them add something that makes me think, "hey, I really need this". Heck, I don't think any of them would even be nice to have. Go error handling in practice actually works very well. I've been writing Go for a long time and I've never had an issue with it. It's not as fancy as Rust but it works and works well, so if it ain't broke, please don't try fixing it. |
|
The weakness in the current design is three-fold for me: - I can "forget" to handle in error (ok this can be linted for maybe?) - There is a lot of ceremony in propagating errors up the chain (a very very very common thing to do!) - The convention of (ok, err) is not always conformed to and ultimately provides no benefit over more concrete typings like Result<T, Err>. Now I can easily grep for fallible operations or operations that call fallible operations!
You may be fine with it - I hear the same argument from my coworkers about checked exceptions in java. I think we can do better.