mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
* refactor: enable errorlint and refactor code * revert * revert * add bazel * gofmt * gofmt * gofmt * gofmt * gci * lint --------- Co-authored-by: Radosław Kapka <rkapka@wp.pl>
27 lines
660 B
Go
27 lines
660 B
Go
package common
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/k0kubun/go-ansi"
|
|
"github.com/schollz/progressbar/v3"
|
|
)
|
|
|
|
func InitializeProgressBar(numItems int, msg string) *progressbar.ProgressBar {
|
|
return progressbar.NewOptions(
|
|
numItems,
|
|
progressbar.OptionFullWidth(),
|
|
progressbar.OptionSetWriter(ansi.NewAnsiStdout()),
|
|
progressbar.OptionEnableColorCodes(true),
|
|
progressbar.OptionSetTheme(progressbar.Theme{
|
|
Saucer: "[green]=[reset]",
|
|
SaucerHead: "[green]>[reset]",
|
|
SaucerPadding: " ",
|
|
BarStart: "[",
|
|
BarEnd: "]",
|
|
}),
|
|
progressbar.OptionOnCompletion(func() { fmt.Println() }),
|
|
progressbar.OptionSetDescription(msg),
|
|
)
|
|
}
|