()
| 350 | } |
| 351 | |
| 352 | func (p *ProgressbarPrinter) parseElapsedTime() string { |
| 353 | // time.Duration.Round panics if the rounding factor is <= 0. |
| 354 | // Guard against invalid values by skipping rounding in this case. |
| 355 | if p.ElapsedTimeRoundingFactor <= 0 { |
| 356 | return p.GetElapsedTime().String() |
| 357 | } |
| 358 | |
| 359 | s := p.GetElapsedTime().Round(p.ElapsedTimeRoundingFactor).String() |
| 360 | return s |
| 361 | } |
no test coverage detected