noop progress bar is nil progress bar
This commit is contained in:
parent
15ee44e857
commit
a9107a8fe9
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue