4 ms·
Go errors prioritize explicitness, in declaration of what functions might fail, and in handling of those failures. It seems like a mistake to add a language fe
by zmj 7y ago
Go errors prioritize explicitness, in declaration of what functions might fail, and in handling of those failures.
It seems like a mistake to add a language feature that works against explicit handling. At minimum, the endorsement of returning the raw error reduces clarity on what "good error handling code" should look like.
- marcus_holmes 7y agoagree totally. I'd prefer to see an official errors.Wrap function instead of "try", for the reasons you cite. (shout out to Dave Cheney's excellent "pkg/errors" implementation of error wrapping)