3 ms·
I’m not sure how that is different than try/catch/finally?
by kasey_junk 9y ago
I’m not sure how that is different than try/catch/finally?
- ngrilly 9y agoThe main difference is that you cannot catch a specific block of code in the function body. You can only catch when leaving the function (in a defer clause in Go). try/catch/finally is really a control structure. panic/recover is not. But I agree the difference is not clear cut and not easy to comprehend without coding a bit using both approaches.