recover() only works in the panicking goroutine
recover() is scoped to the goroutine that panicked. A deferred recover in main does nothing for a panic in a goroutine you spawned — that …
August 14, 2026
Tag
recover() is scoped to the goroutine that panicked. A deferred recover in main does nothing for a panic in a goroutine you spawned — that …
August 14, 2026

I was hit by one of these “you didn’t know this, now suffer” moments today. I was working on a websocket server and was gradually adding new …
June 3, 2025