godoc comments
Vladimir Bauer
4 years ago
| 177 | 177 |
}
|
| 178 | 178 |
|
| 179 | 179 |
// SetTotal sets total to an arbitrary value. Setting it to negative
|
| 180 | |
// value is equivalent to (*Bar).SetTotal((*Bar).Current(), bool).
|
|
180 |
// value is equivalent to (*Bar).SetTotal((*Bar).Current(), bool). If
|
|
181 |
// triggerCompleteNow is true, current value is set to total and
|
|
182 |
// complete event is triggered right away.
|
| 181 | 183 |
func (b *Bar) SetTotal(total int64, triggerCompleteNow bool) {
|
| 182 | 184 |
select {
|
| 183 | 185 |
case b.operateState <- func(s *bState) {
|
| 105 | 105 |
}
|
| 106 | 106 |
|
| 107 | 107 |
// Add creates a bar which renders itself by provided filler.
|
| 108 | |
// If `total <= 0` trigger complete event is disabled until reset with (*bar).SetTotal(int64, bool).
|
| 109 | |
// Panics if *Progress instance is done, i.e. called after (*Progress).Wait.
|
|
108 |
// If `total <= 0` triggering complete event by increment methods is disabled.
|
|
109 |
// Panics if (*Progress) instance is done, i.e. called after (*Progress).Wait().
|
| 110 | 110 |
func (p *Progress) Add(total int64, filler BarFiller, options ...BarOption) *Bar {
|
| 111 | 111 |
if filler == nil {
|
| 112 | 112 |
filler = NopStyle().Build()
|