Quiz · Functions as values · lesson 8 of 12Quiz — panic and recoverWhat do panic and recover do, and where does recover work?[A]panic unwinds the stack but skips deferred calls, so cleanup is lost on the way up. recover may be called from any function the panicking one invoked, where it re-throws to the caller. It is the idiomatic tool for expected conditions like a missing map key, used instead of error.[B]panic stops normal flow and unwinds the stack, running deferred calls on the way up; unhandled, it crashes. recover works only inside a deferred function: it returns the panic value and stops the unwinding. Use both only for exceptional cases.[C]panic quietly logs a message and lets the function continue from the next line, so deferred calls never fire during one. recover works anywhere in the body, not in a defer, and resumes right after the panic site. Both are the normal way to report routine failures, replacing error.[D]panic stops the program and runs deferred calls, but recover only suppresses the crash message without stopping the unwinding, so the program still exits. To truly catch a panic you must wrap the call in a try block.Subscribe to take the courseThe course is free. Sign in with Telegram and subscribe to the channel to open every lesson.Continue with TelegramSign in another way← Backpanic and recoverNext →Exercise: filter