New returns a new ErrorContext that extends the parent context
(parent context.Context)
| 54 | |
| 55 | // New returns a new ErrorContext that extends the parent context |
| 56 | func New(parent context.Context) (context.Context, CancelFunc) { |
| 57 | parent, cancel := context.WithCancel(parent) |
| 58 | ctx := &ErrorContext{Context: parent, cancel: cancel} |
| 59 | return ctx, ctx.Cancel |
| 60 | } |
no outgoing calls