Codebase list golang-github-vbauerster-mpb / ad60577
(*Progress).AddBarWithID signature change Vladimir Bauer 9 years ago
2 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
5252 till int64
5353 }
5454 state struct {
55 id int64
55 id int
5656 format formatRunes
5757 etaAlpha float64
5858 barWidth int
6969 }
7070 )
7171
72 func newBar(ctx context.Context, wg *sync.WaitGroup, id, total int64, width int, format string) *Bar {
72 func newBar(ctx context.Context, wg *sync.WaitGroup, id int, total int64, width int, format string) *Bar {
7373 b := &Bar{
7474 formatElementCh: make(chan runeFormatElement),
7575 etaAlphaCh: make(chan float64),
219219 }
220220
221221 // GetID returs id of the bar
222 func (b *Bar) GetID() int64 {
222 func (b *Bar) GetID() int {
223223 state := b.getState()
224224 return state.id
225225 }
288288 return state.draw(termWidth)
289289 }
290290
291 func (b *Bar) server(ctx context.Context, wg *sync.WaitGroup, id, total int64, width int, format string) {
291 func (b *Bar) server(ctx context.Context, wg *sync.WaitGroup, id int, total int64, width int, format string) {
292292 var completed bool
293293 timeStarted := time.Now()
294294 blockStartTime := timeStarted
138138
139139 // AddBarWithID creates a new progress bar and adds to the container
140140 // pancis, if called on stopped Progress instance, i.e after Stop()
141 func (p *Progress) AddBarWithID(id, total int64) *Bar {
141 func (p *Progress) AddBarWithID(id int, total int64) *Bar {
142142 if IsClosed(p.done) {
143143 panic(ErrCallAfterStop)
144144 }