AI coding workspace
Go cancellation
Cancellation must reach the place that is waiting. GoChannel Desk is a Windows AI coding workspace for tracing context signals through Go source files and reviewing how a worker can exit.
● ● ●GoChannel Desk●
A concrete starting point · Go cancellation ×
if err := ctx.Err(); err != nil {
return err
}
select {
case results <- value:
return nil
case <-ctx.Done():
return ctx.Err()
}✳Make a Go worker stop when its context is cancelled while waiting to send a result.
✓ ChangesReview before applying ↗
Illustrative workspace
| Review before applying | Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes. |
|---|---|
| Connection | Base URL, credentials and a reachable server. |
| Project | Exercise cancellation before startup and during a blocked send, checking that the worker exits without closing a channel it does not own. |
A concrete starting point
if err := ctx.Err(); err != nil {
return err
}
select {
case results <- value:
return nil
case <-ctx.Done():
return ctx.Err()
}