4 ms·
I think that's the intention of a panic.. however there is still recover if you need to "catch" it.
by fileeditview 2y ago
I think that's the intention of a panic.. however there is still recover if you need to "catch" it.
- frontfor 2y agoThe 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.
- hnlmorg 2y agoThe 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.