From: Rob Pike Date: Tue, 14 Jan 2014 23:04:16 +0000 (-0800) Subject: reflect: better document the tri-state for TryRecv X-Git-Tag: go1.3beta1~970 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=591265fcb4ab80d6a000521eb607600e81c83155;p=gostls13.git reflect: better document the tri-state for TryRecv R=rsc, iant CC=golang-codereviews https://golang.org/cl/52360043 --- diff --git a/src/pkg/reflect/value.go b/src/pkg/reflect/value.go index 89d329257b..30b5e2a92f 100644 --- a/src/pkg/reflect/value.go +++ b/src/pkg/reflect/value.go @@ -1832,9 +1832,9 @@ func (v Value) String() string { // TryRecv attempts to receive a value from the channel v but will not block. // It panics if v's Kind is not Chan. -// If the receive cannot finish without blocking, x is the zero Value. -// The boolean ok is true if the value x corresponds to a send -// on the channel, false if it is a zero value received because the channel is closed. +// If the receive delivers a value, x is the transferred value and ok is true. +// If the receive cannot finish without blocking, x is the zero Value and ok is false. +// If the channel is closed, x is the zero value for the channel's element type and ok is false. func (v Value) TryRecv() (x Value, ok bool) { v.mustBe(Chan) v.mustBeExported()