From 1022d31da97394f22c293a8124e6629fb4e6f2d8 Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 26 Nov 2021 11:38:16 +0100 Subject: [PATCH] Add progresss bar implementation --- pb.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pb.go b/pb.go index f0688ab..f00a509 100644 --- a/pb.go +++ b/pb.go @@ -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,