]> Cypherpunks.ru repositories - gostls13.git/commitdiff
context: document that Err is unspecified before Done
authorIan Lance Taylor <iant@golang.org>
Tue, 21 Feb 2017 20:48:45 +0000 (12:48 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 22 Feb 2017 17:42:28 +0000 (17:42 +0000)
It could have been defined the other way, but since the behavior has
been unspecified, this is the conservative approach for people writing
different implementations of the Context interface.

Change-Id: I7334a4c674bc2330cca6874f7cac1eb0eaea3cff
Reviewed-on: https://go-review.googlesource.com/37375
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Sameer Ajmani <sameer@golang.org>
Run-TryBot: Sameer Ajmani <sameer@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/context/context.go

index c60d3788184633776c0eedd0b25c26e11c48ae9b..cfd1c09fcc1844a52c4e64c99ac7c42b751646e2 100644 (file)
@@ -100,6 +100,7 @@ type Context interface {
        // Canceled if the context was canceled or DeadlineExceeded if the
        // context's deadline passed. No other values for Err are defined.
        // After Done is closed, successive calls to Err return the same value.
+       // Err's return value is unspecified before Done is closed.
        Err() error
 
        // Value returns the value associated with this context for key, or nil