We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3664d28 commit 11a4ba6Copy full SHA for 11a4ba6
internal/output/progress_tty.go
@@ -208,7 +208,11 @@ func (p *progressTTY) writeLine(bar *ProgressBar) {
208
209
// Unicode box drawing gives us eight possible bar widths, so we need to
210
// calculate both the bar width and then the final character, if any.
211
- segments := int(math.Round((float64(8*barWidth) * value) / bar.Max))
+ var segments int
212
+ if bar.Max > 0 {
213
+ segments = int(math.Round((float64(8*barWidth) * value) / bar.Max))
214
+ }
215
+
216
fillWidth := segments / 8
217
remainder := segments % 8
218
if remainder == 0 {
0 commit comments