Panic and recover
This chapter assumes knowledge of defer.
recover are technically similar to exception handling in languages like C#, Java or Python.
panic is equivalent of
recover fills the role of
However, while those other languages often use exceptions as a way to propagate errors up the call chain, using
panic in Go is highly discouraged.
It should only be used in truly exceptional cases.
For ordinary error handling, read chapter on error handling.