Codebase list golang-github-vbauerster-mpb / 63e67c5
ctx must not be nil Vladimir Bauer 8 years ago
1 changed file(s) with 3 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
66 // WithContext provided context will be used for cancellation purposes
77 func WithContext(ctx context.Context) ProgressOption {
88 return func(s *pState) {
9 if ctx != nil {
10 s.cancel = ctx.Done()
9 if ctx == nil {
10 panic("ctx must not be nil")
1111 }
12 s.cancel = ctx.Done()
1213 }
1314 }