noop progress bar is nil progress bar

This commit is contained in:
Adrien Delorme 2020-09-24 10:52:45 +02:00
parent 15ee44e857
commit a9107a8fe9
1 changed files with 1 additions and 4 deletions

View File

@ -18,16 +18,13 @@ func ProgressBarConfig(bar *pb.ProgressBar, prefix string) {
// UiProgressBar is a progress bar compatible with go-getter used in our
// UI structs.
type UiProgressBar struct {
Noop bool
lock sync.Mutex
pool *pb.Pool
pbs int
}
var noOpProgressBar *UiProgressBar = nil
func (p *UiProgressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser {
if p.Noop {
if p == nil {
return stream
}
p.lock.Lock()