Skip to content
masterclass Buddy

Go · Function

panic

panic starts stack unwinding and runs deferred functions. recover can stop that unwinding only when called directly by a deferred function in the same goroutine.

Last updated

Syntax

func recover() any

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • panic
  • defer
  • error
  • goroutine

Source: Go Wiki: PanicAndRecover. Checked 2026-11-03.