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

I think that's the intention of a panic.. however there is still recover if you need to "catch" it.



The issue is you need to explicitly recover each goroutine just so a nil dereference or a panic from a library you have no control over doesn’t bring down the whole application. Maybe this is the way it has to be, but it is a little known fact that might bite you.


The only time a library should be panicking is if they’ve reached a state they cannot continue from.

I’d be interested to know which libraries you’re working with where this has been a problem because I’ve only ever experienced one occasion where a 3rd party library panicked unnecessarily.




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

Search: