Codebase list golang-github-vbauerster-mpb / 770294e
SetRefill Vladimir Bauer 7 years ago
1 changed file(s) with 10 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
185185 }
186186 }
187187
188 // RefillBy fills bar with different r rune.
189 func (b *Bar) RefillBy(n int, r rune) {
188 // SetRefill sets fill rune to r, up until n.
189 func (b *Bar) SetRefill(n int, r rune) {
190 if n <= 0 {
191 return
192 }
190193 b.operateState <- func(s *bState) {
191194 s.refill = &refill{r, int64(n)}
192195 }
193 b.IncrBy(n)
196 }
197
198 // RefillBy is deprecated, use SetRefill
199 func (b *Bar) RefillBy(n int, r rune) {
200 b.SetRefill(n, r)
194201 }
195202
196203 // Increment is a shorthand for b.IncrBy(1).