Err returns the err of the ErrorContext if non-nil, or the error of the underlying Context.
()
| 44 | |
| 45 | // Err returns the err of the ErrorContext if non-nil, or the error of the underlying Context. |
| 46 | func (c *ErrorContext) Err() error { |
| 47 | c.mu.Lock() |
| 48 | defer c.mu.Unlock() |
| 49 | if c.err != nil { |
| 50 | return c.err |
| 51 | } |
| 52 | return c.Context.Err() |
| 53 | } |
| 54 | |
| 55 | // New returns a new ErrorContext that extends the parent context |
| 56 | func New(parent context.Context) (context.Context, CancelFunc) { |
no outgoing calls