๐Ÿ”—Context WorkshopWORKSHOP
1
2
3

Step 1

Cancel a goroutine via `ctx.Done()`. Create a context with `context.WithCancel`, launch a goroutine that loops forever printing "working..." every 50 ms until `<-ctx.Done()`, then after 150 ms call `cancel()` from main and wait for the goroutine to finish using a `sync.WaitGroup`.

โŒ˜ Enter (Mac) ยท Ctrl+Enter (Win/Linux)