3 ms·
> I strongly believe in halting on error as the default response, and unwinding until the correct layer can proceed. Isn't this is exactly what happens in Go
by rifung 7y ago
> I strongly believe in halting on error as the default response, and unwinding until the correct layer can proceed.
Isn't this is exactly what happens in Go code with the current implementation? At least all the Go code I've read seems to do this.
If you don't know what to do or can't do anything, you return the same error, preferably adding more details to the error string. If you do know what to do you handle it.
I much prefer that everyone has to make an explicit choice on what to do; I find following code with exceptions much more painful.
- Nullabillity 7y agoThe Go default (if you don't do anything with the error value) is to just keep trucking as if nothing happened. The community convention seems to be keep rewriting the `if err` dance, but there's nothing encouraging that in the language itself.