Panic stops normal execution:
panic("something terrible happened")
Panic unwinds the stack, running deferred functions along the way. If not recovered, your program crashes with a stack trace. Use panic only for unrecoverable situations.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
When things go wrong
Panic stops normal execution:
panic("something terrible happened")
Panic unwinds the stack, running deferred functions along the way. If not recovered, your program crashes with a stack trace. Use panic only for unrecoverable situations.