Codebase list golang-github-vbauerster-mpb / ddf99f1 progress_go1.7.go
ddf99f1

Tree @ddf99f1 (Download .tar.gz)

progress_go1.7.go @ddf99f1raw · history · blame

//+build go1.7

package mpb

import "context"

// WithContext Deprecated, use mpb.WithContext
func (p *Progress) WithContext(ctx context.Context) *Progress {
	if ctx == nil {
		panic("nil context")
	}
	return updateConf(p, func(c *pConf) {
		c.cancel = ctx.Done()
	})
}