mirror of
https://github.com/XIU2/CloudflareSpeedTest.git
synced 2026-03-03 04:17:03 +08:00
19 lines
249 B
Go
19 lines
249 B
Go
package utils
|
|
|
|
import "github.com/cheggaaa/pb/v3"
|
|
|
|
type Bar struct {
|
|
pb *pb.ProgressBar
|
|
}
|
|
|
|
func NewBar(count int) *Bar {
|
|
return &Bar{pb.Simple.Start(count)}
|
|
}
|
|
|
|
func (b *Bar) Grow(num int) {
|
|
b.pb.Add(num)
|
|
}
|
|
|
|
func (b *Bar) Done() {
|
|
b.pb.Finish()
|
|
} |