3 ms·
I don't recover from panics in production Go and none of the code I depend on panics to handle errors. Errors are handled the long and boring way inline and I
by crawshaw 8y ago
I don't recover from panics in production Go and none of the code I depend on panics to handle errors.
Errors are handled the long and boring way inline and I like it that way. (I would like better tools for making better errors, but not for pretending errors don't exist.) When I work in C, I do the same.
Your charactization of Go as I know it is wrong.
- weitzj 8y agoI prefer the boring way as well and it should stay like this. My gut feeling would be that otherwise, instead of handling errors locally, you “sprinkle” your code with “try” keywords. Afterwards you want to distinguish between exception types and eventually you end up switching over these types in a big switch higher up.