Hacker News new | past | comments | ask | show | jobs | submit login

I’m not sure how that is different than try/catch/finally?



The 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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: