Y
Hacker News
new
|
ask
|
show
|
jobs
by
oconnor663
3147 days ago
What's the connection between `defer` and goroutines?
3 comments
shurcooL
3147 days ago
Not a strong connection, but both features are managed by the Go runtime.
link
noncoml
3146 days ago
Yeah, none. I wrote this while still in bed. No idea what I was thinking at the time :D
link
camus2
3147 days ago
None, the feature that completely depends on defer is recovering from panics.
The order in which defer statements are executed is predictable, unlike goroutines.
link