Panic

Noun · Development

Definitions

  1. An unrecoverable runtime error that immediately unwinds (or aborts) the current thread or goroutine, used in Go and Rust when a program reaches a state that is considered a bug rather than an expected failure. In Rust, indexing out of bounds triggers a panic; in Go, calling `panic()` halts normal execution and begins running deferred functions.

    In plain English: When a program hits a problem so bad it immediately crashes on purpose rather than trying to limp along in a broken state.

    Example: "The service panicked on startup because the required environment variable wasn't set — which is the correct behavior, fail fast rather than silently misconfig."

Related Terms