context.Context: отмена и таймаут по цепочке вызовов
Содержание курса
Горутина выполняет:
func worker(ctx context.Context) {
select {
case <-ctx.Done():
fmt.Println(ctx.Err())
return
case <-time.After(10 * time.Second):
fmt.Println("done")
}
}
Контекст создан через context.WithTimeout(context.Background(), 200*time.Millisecond). Что напечатает горутина?
