Context returns underlying command context. If command was executed with ExecuteContext or the context was set with SetContext, the previously set context will be returned. Otherwise, nil is returned. Notice that a call to Execute and ExecuteC will replace a nil context of a command with a context.
()
| 267 | // a command with a context.Background, so a background context will be |
| 268 | // returned by Context after one of these functions has been called. |
| 269 | func (c *Command) Context() context.Context { |
| 270 | return c.ctx |
| 271 | } |
| 272 | |
| 273 | // SetContext sets context for the command. This context will be overwritten by |
| 274 | // Command.ExecuteContext or Command.ExecuteContextC. |
no outgoing calls