Go · Interface
context.Context
Use context.Context to carry cancellation and deadlines through Go calls. Create a derived context with a timeout, pass it to the operation, and always call the returned cancel function.
Last updated
Syntax
func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
ContextWithCancelWithCancelCauseWithDeadlineWithTimeoutCauseDoneErrCause