mirror of
https://github.com/golang/go
synced 2024-11-24 00:30:15 -07:00
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 <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>
This commit is contained in:
parent
ea48c9d232
commit
dc6af19ff8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user