avoid panic
This commit is contained in:
parent
6d0066eafa
commit
296ae4305f
@ -39,9 +39,12 @@ func barString(total, y, g float64) string {
|
|||||||
yBars := int(math.Round(y / total * barCols))
|
yBars := int(math.Round(y / total * barCols))
|
||||||
gBars := int(math.Round(g / total * barCols))
|
gBars := int(math.Round(g / total * barCols))
|
||||||
eBars := int(barCols) - yBars - gBars
|
eBars := int(barCols) - yBars - gBars
|
||||||
return color.YellowString(strings.Repeat("|", yBars)) +
|
var barString = color.YellowString(strings.Repeat("|", yBars)) +
|
||||||
color.GreenString(strings.Repeat("|", gBars)) +
|
color.GreenString(strings.Repeat("|", gBars))
|
||||||
strings.Repeat(" ", eBars)
|
if eBars >= 0 {
|
||||||
|
barString += strings.Repeat(" ", eBars)
|
||||||
|
}
|
||||||
|
return barString
|
||||||
}
|
}
|
||||||
|
|
||||||
var sealingWorkersCmd = &cli.Command{
|
var sealingWorkersCmd = &cli.Command{
|
||||||
|
Loading…
Reference in New Issue
Block a user