We explain how
recover() works in Go and why it only makes sense inside
defer: how to catch
panic at the application boundary, build the safe main pattern through
safeRun(), turn a panic value into a neat
error, and, if needed, print a stack trace through
debug.Stack(). At the end, we look at typical mistakes when using
panic/
recover.