Beginner Go (Golang)
Q23 / 100

What is panic in Go?

Correct! Well done.

Incorrect.

The correct answer is B) An unrecoverable runtime error that unwinds the stack, unless caught by recover()

B

Correct Answer

An unrecoverable runtime error that unwinds the stack, unless caught by recover()

Explanation

panic(msg) stops normal execution and begins unwinding. Use recover() inside a deferred function to catch panics. Don't use panic for ordinary errors.

Progress
23/100