Codebase list golang-github-vbauerster-mpb / d25ea70
fix example Vladimir Bauer 6 years ago
2 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
6363
6464 func makeLogBar(msg string) mpb.BarFiller {
6565 limit := "%%.%ds"
66 return mpb.BarFillerFunc(func(w io.Writer, width int, st decor.Statistics) {
67 fmt.Fprintf(w, fmt.Sprintf(limit, width), msg)
66 return mpb.BarFillerFunc(func(w io.Writer, _ int, st decor.Statistics) {
67 fmt.Fprintf(w, fmt.Sprintf(limit, st.TermWidth-st.OccupiedWidth), msg)
6868 })
6969 }
100100 default:
101101 }
102102 if msg != nil {
103 limitFmt := fmt.Sprintf("%%.%ds", width)
103 limitFmt := fmt.Sprintf("%%.%ds", st.TermWidth-st.OccupiedWidth)
104104 fmt.Fprintf(w, limitFmt, *msg)
105105 nextCh <- struct{}{}
106106 } else {