Go · Function
context.WithTimeout
context.WithTimeout creates a context that is canceled after a time limit. It returns the new context and a function that can cancel it earlier.
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
ContextWithDeadlineWithCancelDeadlineExceededCanceled