AddMax64 is basically the same as AddMax, but takes in a int64 to avoid casting
(added int64)
| 898 | // but takes in a int64 |
| 899 | // to avoid casting |
| 900 | func (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 |
| 921 | func (p *ProgressBar) IsFinished() bool { |
no test coverage detected