Comment

Comment by ricardobeat

Strange to go all this length without mentioning the approaches that solve the problem in that first example:

1. send a close message on the channel that stops the goroutine

2. use a Context instance - `ctx.Done()` returns a channel you can select on

Both are quite easy to grasp and implement.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton