Add to current value.
(count int)
| 266 | |
| 267 | // Add to current value. |
| 268 | func (p *ProgressbarPrinter) Add(count int) *ProgressbarPrinter { |
| 269 | if p.Total == 0 { |
| 270 | return nil |
| 271 | } |
| 272 | |
| 273 | p.Current += count |
| 274 | p.updateProgress() |
| 275 | |
| 276 | if p.Current >= p.Total { |
| 277 | p.Total = p.Current |
| 278 | p.updateProgress() |
| 279 | p.Stop() |
| 280 | } |
| 281 | return p |
| 282 | } |
| 283 | |
| 284 | // Start the ProgressbarPrinter. |
| 285 | func (p ProgressbarPrinter) Start(title ...any) (*ProgressbarPrinter, error) { |
no test coverage detected