DEV Community

Discussion on: Timeout using context package in Go

Collapse
 
sebogh profile image
Sebastian Bogan • Edited

I may be worthwhile mentioning that the second goroutine is executed (as opposed to the comments). Only execute() is gone and thus the print is not happening.

If the second goroutine would be an "endless" loop without checking ctx.Done(), it would be leaked.

Collapse
 
hgsgtk profile image
Kazuki Higashiguchi

Thank you so much for your point out! I'm a little busy with work right now, so I'll watch it this weekend.

Collapse
 
tfutada profile image
Takashi Futada

Is it a forgotten sender?