NewWithContext: ctx nil check
Vladimir Bauer
3 years ago
| 63 | 63 | // context. It's not possible to reuse instance after (*Progress).Wait |
| 64 | 64 | // method has been called. |
| 65 | 65 | func NewWithContext(ctx context.Context, options ...ContainerOption) *Progress { |
| 66 | if ctx == nil { | |
| 67 | ctx = context.Background() | |
| 68 | } | |
| 66 | 69 | ctx, cancel := context.WithCancel(ctx) |
| 67 | 70 | s := &pState{ |
| 68 | 71 | ctx: ctx, |