On Mon, Apr 3, 2023 at 3:40 PM Konstantin Kulikov <k.kulik...@gmail.com> wrote: > select { > case <-ctx.Done(): > case linksCh <- links: > }
On Tue, Apr 4, 2023 at 1:15 AM burak serdar <bser...@computer.org> wrote: > select { > case <-pause: > case <-done: > return > } Thanks, but I think both of these fall under: By non-trivial, I mean that a lot of the selects that I've seen have exactly two cases, one of them doing "real work" and the other being either (1) "default" or (2) a timeout/cancel channel (e.g. ctx.Done()). Even if you do some work after a timeout, the select itself is still collapsable to a single cancellable recv. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOeFMNViPhKmx_YnJHuDiS_E63tw1UcX7TUiDO%2Bhg2W9zJq8yg%40mail.gmail.com.