From dc6af19ff8b44e56abc1217af27fe098c78c932b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 21 Feb 2017 12:48:45 -0800 Subject: [PATCH] context: document that Err is unspecified before Done 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 Reviewed-by: Brad Fitzpatrick Reviewed-by: Sameer Ajmani Run-TryBot: Sameer Ajmani TryBot-Result: Gobot Gobot --- src/context/context.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/context/context.go b/src/context/context.go index c60d378818..cfd1c09fcc 100644 --- a/src/context/context.go +++ b/src/context/context.go @@ -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