Hacker News new | ask | show | jobs
by oconnor663 3147 days ago
What's the connection between `defer` and goroutines?
3 comments

Not a strong connection, but both features are managed by the Go runtime.
Yeah, none. I wrote this while still in bed. No idea what I was thinking at the time :D
None, the feature that completely depends on defer is recovering from panics.

The order in which defer statements are executed is predictable, unlike goroutines.