Codebase list golang-github-vbauerster-mpb / fcfe115
make PercentageType private Vladimir Bauer 6 years ago
1 changed file(s) with 3 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
77 "github.com/vbauerster/mpb/v4/internal"
88 )
99
10 // PercentageType named type, which implements fmt.Formatter interface.
11 // It appends `%` sign to its value.
12 type PercentageType float64
10 type percentageType float64
1311
14 func (s PercentageType) Format(st fmt.State, verb rune) {
12 func (s percentageType) Format(st fmt.State, verb rune) {
1513 var prec int
1614 switch verb {
1715 case 'd':
7472 return d.FormatMsg(*d.completeMsg)
7573 }
7674 p := internal.Percentage(st.Total, st.Current, 100)
77 return d.FormatMsg(fmt.Sprintf(d.fmt, PercentageType(p)))
75 return d.FormatMsg(fmt.Sprintf(d.fmt, percentageType(p)))
7876 }
7977
8078 func (d *percentageDecorator) OnCompleteMessage(msg string) {