MCPcopy Create free account
hub / github.com/schollz/progressbar / AddMax64

Method AddMax64

progressbar.go:900–918  ·  view source on GitHub ↗

AddMax64 is basically the same as AddMax, but takes in a int64 to avoid casting

(added int64)

Source from the content-addressed store, hash-verified

898// but takes in a int64
899// to avoid casting
900func (p *ProgressBar) AddMax64(added int64) {
901 p.lock.Lock()
902
903 p.config.max += added
904
905 if p.config.showBytes {
906 p.config.maxHumanized, p.config.maxHumanizedSuffix = humanizeBytes(float64(p.config.max),
907 p.config.useIECUnits)
908 }
909
910 if p.config.max == -1 {
911 p.lengthUnknown()
912 } else {
913 p.lengthKnown(p.config.max)
914 }
915 p.lock.Unlock() // so p.Add can lock
916
917 p.Add(0) // re-render
918}
919
920// IsFinished returns true if progress bar is completed
921func (p *ProgressBar) IsFinished() bool {

Callers 1

AddMaxMethod · 0.95

Calls 4

lengthUnknownMethod · 0.95
lengthKnownMethod · 0.95
AddMethod · 0.95
humanizeBytesFunction · 0.85

Tested by

no test coverage detected