There's a reason Go doesn't support non-random selects. Often, you'll be
selecting on channels which peers are accessing concurrently. In this
situation, there's no ordering guarantee between when different cases will
become available. If case 2 can become available ever-so-slightly before
case 1,
On Friday, May 11, 2018 at 11:54:16 AM UTC-4, Jake Montgomery wrote:
>
> As others on this thread have pointed out, this use case does not actually
> require select where the cases are checked in order.
>
> However, for completeness, if you need to check two channels, and they
> must be checke
As others on this thread have pointed out, this use case does not actually
require select where the cases are checked in order.
However, for completeness, if you need to check two channels, and they must
be checked in order, then use two select statements with defaults:
for {
select {
c
>Talking about the select() or poll() functions from the C library which
evidently were an inspiration for the Go select statement
Go select is more similar to alt() than select() or poll()
On Friday, May 4, 2018 at 7:24:56 AM UTC-7, Andriy Pylypenko wrote:
>
> Hi,
>
> I have a scenario which I