July 2017
Beginner to intermediate
358 pages
10h 54m
English
The WithTimeout method is similar to WithDeadline except you pass it a duration for which the Context type should exist. Once this duration has elapsed, the Done channel is closed and the resources associated with the context are released:
func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc)
Read now
Unlock full access