|
|
|
|
|
by preseinger
1257 days ago
|
|
> Is the alternative to crash and restart the whole process on panic? Yes. > assuming that you can catch panics at all A panic may happen to be safe to catch and recover from, but this isn't guaranteed, and can't be assumed in general. It's only safe to recover from a panic which you know is benign -- in all cases, across all build and runtime architectures. This is possible in packages that you fully control and which have no external dependencies, or (by fiat) in stdlib packages like net/http. But it's not the case for your service binary with a go.mod that's 100 lines long. |
|