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 { var progress *mpb.Progress = nil
progress := mpb.New(
func init() {
progress = mpb.New(
mpb.WithWidth(barWidthDefault), mpb.WithWidth(barWidthDefault),
mpb.WithRefreshRate(barRefreshRateDefault), mpb.WithRefreshRate(barRefreshRateDefault),
) )
}
func newProgressBarImpl() *progressBarImpl {
bar := createMpbBar(progress, 0, "", ProgressStateConnecting, nil) bar := createMpbBar(progress, 0, "", ProgressStateConnecting, nil)
return &progressBarImpl{ return &progressBarImpl{
progress: progress, progress: progress,