diff --git a/options_go1.7.go b/options_go1.7.go index 61d94aa..ca9a5ba 100644 --- a/options_go1.7.go +++ b/options_go1.7.go @@ -7,8 +7,9 @@ // WithContext provided context will be used for cancellation purposes func WithContext(ctx context.Context) ProgressOption { return func(s *pState) { - if ctx != nil { - s.cancel = ctx.Done() + if ctx == nil { + panic("ctx must not be nil") } + s.cancel = ctx.Done() } }