Commit f2113c1f authored by Jeffrey Morgan's avatar Jeffrey Morgan
Browse files

fix potential error in progress bar calculation

parent 6452e2ec
...@@ -95,7 +95,10 @@ func (b *Bar) String() string { ...@@ -95,7 +95,10 @@ func (b *Bar) String() string {
} }
// 44 is the maximum width for the stats on the right of the progress bar // 44 is the maximum width for the stats on the right of the progress bar
suf.WriteString(strings.Repeat(" ", 44-suf.Len()-len(timing))) pad := 44 - suf.Len() - len(timing)
if pad > 0 {
suf.WriteString(strings.Repeat(" ", pad))
}
suf.WriteString(timing) suf.WriteString(timing)
// add 3 extra spaces: 2 boundary characters and 1 space at the end // add 3 extra spaces: 2 boundary characters and 1 space at the end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment