The cost of Go's panic and recover
TL;DR ¶
Some of the wisdom contained in Josh Bloch’s Effective Java book is
relevant to Go.
panic and recover are best reserved for exceptional circumstances.
Reliance on panic and recover can noticeably slow down execution, incurs
heap allocations, and precludes inlining.
Internal handling of failure cases via panic and recover is tolerable and
sometimes beneficial.
Abusing Java exceptions for control flow ¶
Even though my Java days are long gone and Go has been my language of predilection
for ...
Read more at jub0bs.com