diff --git a/src/10-standard-lib/76-time-after/main.go b/src/10-standard-lib/76-time-after/main.go index 56f7004..de7aff4 100644 --- a/src/10-standard-lib/76-time-after/main.go +++ b/src/10-standard-lib/76-time-after/main.go @@ -18,8 +18,8 @@ func consumer1(ch <-chan Event) { } func consumer2(ch <-chan Event) { + ctx, cancel := context.WithTimeout(context.Background(), time.Hour) for { - ctx, cancel := context.WithTimeout(context.Background(), time.Hour) select { case event := <-ch: cancel()