Skip to content
Myr

add comment for context (#1413)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

ref #1075 annotation from go context source.

authored by 田欧 · committed by Bo-Yi Wu · parent c00f21f · Browse files · 1 file+15 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+15 added−0 removed

  • other:+15 added−0 removed

1 file+15 added−0 removed

modified:context.go+15 added
834 unmodified lines
835/************************************/836/***** GOLANG.ORG/X/NET/CONTEXT *****/837/************************************/838839// Deadline returns the time when work done on behalf of this context840// should be canceled. Deadline returns ok==false when no deadline is841// set. Successive calls to Deadline return the same results.842func (c *Context) Deadline() (deadline time.Time, ok bool) {843 return844}845846// Done returns a channel that's closed when work done on behalf of this847// context should be canceled. Done may return nil if this context can848// never be canceled. Successive calls to Done return the same value.849func (c *Context) Done() <-chan struct{} {850 return nil851}852853// Err returns a non-nil error value after Done is closed,854// successive calls to Err return the same error.855// If Done is not yet closed, Err returns nil.856// If Done is closed, Err returns a non-nil error explaining why:857// Canceled if the context was canceled858// or DeadlineExceeded if the context's deadline passed.859func (c *Context) Err() error {860 return nil861}862863// Value returns the value associated with this context for key, or nil864// if no value is associated with key. Successive calls to Value with865// the same key returns the same result.866func (c *Context) Value(key interface{}) interface{} {867 if key == 0 {868 return c.Request869 }
6 unmodified lines