1
0
mirror of https://github.com/golang/go synced 2024-11-26 08:58:09 -07:00

reflect: document tie-breaking in Select

The exact words are taken from the spec.

Fixes some confusion on golang-nuts.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7353044
This commit is contained in:
Russ Cox 2013-02-19 10:13:53 -05:00
parent d137a2cb56
commit a6db2a8517

View File

@ -1791,8 +1791,9 @@ type SelectCase struct {
} }
// Select executes a select operation described by the list of cases. // Select executes a select operation described by the list of cases.
// Like the Go select statement, it blocks until one of the cases can // Like the Go select statement, it blocks until at least one of the cases
// proceed and then executes that case. It returns the index of the chosen case // can proceed, makes a uniform pseudo-random choice,
// and then executes that case. It returns the index of the chosen case
// and, if that case was a receive operation, the value received and a // and, if that case was a receive operation, the value received and a
// boolean indicating whether the value corresponds to a send on the channel // boolean indicating whether the value corresponds to a send on the channel
// (as opposed to a zero value received because the channel is closed). // (as opposed to a zero value received because the channel is closed).