diff --git a/bar_filler_bar.go b/bar_filler_bar.go index 5442723..0904d17 100644 --- a/bar_filler_bar.go +++ b/bar_filler_bar.go @@ -20,8 +20,8 @@ rRefill ) -// DefaultBarStyle is a string containing 7 runes. -// Each rune is a building block of a progress bar. +// BarDefaultStyle is a style for rendering a progress bar. +// It consist of 7 ordered runes: // // '1st rune' stands for left boundary rune // @@ -37,7 +37,7 @@ // // '7th rune' stands for refill rune // -const DefaultBarStyle string = "[=>-]<+" +const BarDefaultStyle string = "[=>-]<+" type barFiller struct { format [][]byte @@ -63,12 +63,12 @@ // NewBarFillerRev same as NewBarFiller but with explicit reverse option. func NewBarFillerRev(style string, rev func() bool) BarFiller { bf := &barFiller{ - format: make([][]byte, len(DefaultBarStyle)), - rwidth: make([]int, len(DefaultBarStyle)), reverse: rev(), + format: make([][]byte, len(BarDefaultStyle)), + rwidth: make([]int, len(BarDefaultStyle)), } - bf.parse(DefaultBarStyle) - if style != "" && style != DefaultBarStyle { + bf.parse(BarDefaultStyle) + if style != "" && style != BarDefaultStyle { bf.parse(style) } return bf diff --git a/progress.go b/progress.go index dfafbf0..383b470 100644 --- a/progress.go +++ b/progress.go @@ -97,7 +97,7 @@ // AddBar creates a new progress bar and adds it to the rendering queue. func (p *Progress) AddBar(total int64, options ...BarOption) *Bar { - return p.Add(total, NewBarFiller(DefaultBarStyle), options...) + return p.Add(total, NewBarFiller(BarDefaultStyle), options...) } // AddSpinner creates a new spinner bar and adds it to the rendering queue.