5 ms·
Honestly I hope they won't break the simplicity of error handling as it is today. It sucks, but it's explicit, simple to understand and ubiquitous: everyone doe
by thiht 3y ago
Honestly I hope they won't break the simplicity of error handling as it is today. It sucks, but it's explicit, simple to understand and ubiquitous: everyone does it the same because there's no choice. Results/Options would have been a better choice from the ground up but it's too late for that, as nothing would be worse than having 2 official ways to handle errors.
The single change I would like is being able to inline my iferrs like this:
if err != nil { return err }
For simple cases where there's no need to log or do extra stuff it would be convenient. Goland already shows the iferrs like this.