Add progresss bar implementation

main
Stefano 2021-11-26 11:38:16 +01:00
parent 85251b17b1
commit 1022d31da9
1 changed files with 6 additions and 2 deletions

8
pb.go
View File

@ -72,12 +72,16 @@ func createMpbBar(p *mpb.Progress, total int, taskName string, state ProgressSta
)
}
func newProgressBarImpl() *progressBarImpl {
progress := mpb.New(
var progress *mpb.Progress = nil
func init() {
progress = mpb.New(
mpb.WithWidth(barWidthDefault),
mpb.WithRefreshRate(barRefreshRateDefault),
)
}
func newProgressBarImpl() *progressBarImpl {
bar := createMpbBar(progress, 0, "", ProgressStateConnecting, nil)
return &progressBarImpl{
progress: progress,