3 ms·
In production code people put panics around? I’ve never seen a situation like this. The convention to not use panic is quite strong
by dgellow 6y ago
In production code people put panics around? I’ve never seen a situation like this. The convention to not use panic is quite strong
- knz42 6y agoAnd yet it certainly is there.
- andreygrehov 6y agoPanics are rare events that very few functions should ever need to think about. If the library truly cannot set itself up, it might be reasonable to panic (which is why panics are usually in the `main` package only). Once all the invariants have been checked, there is no reason to panic anytime after.