MCPcopy
hub / github.com/pterm/pterm / Add

Method Add

progressbar_printer.go:268–282  ·  view source on GitHub ↗

Add to current value.

(count int)

Source from the content-addressed store, hash-verified

266
267// Add to current value.
268func (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.
285func (p ProgressbarPrinter) Start(title ...any) (*ProgressbarPrinter, error) {

Callers 1

IncrementMethod · 0.95

Calls 2

updateProgressMethod · 0.95
StopMethod · 0.95

Tested by

no test coverage detected