build(deps): bump github.com/vbauerster/mpb/v8 from 8.2.1 to 8.3.0

Bumps [github.com/vbauerster/mpb/v8](https://github.com/vbauerster/mpb) from 8.2.1 to 8.3.0.
- [Release notes](https://github.com/vbauerster/mpb/releases)
- [Commits](https://github.com/vbauerster/mpb/compare/v8.2.1...v8.3.0)

---
updated-dependencies:
- dependency-name: github.com/vbauerster/mpb/v8
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2023-03-13 12:59:15 +00:00
committed by GitHub
parent 5cb18a9f47
commit 6f9f395b3c
4 changed files with 24 additions and 11 deletions

View File

@ -128,13 +128,26 @@ func (p *Progress) AddSpinner(total int64, options ...BarOption) *Bar {
// New creates a bar by calling `Build` method on provided `BarFillerBuilder`.
func (p *Progress) New(total int64, builder BarFillerBuilder, options ...BarOption) *Bar {
return p.AddFiller(total, builder.Build(), options...)
return p.MustAdd(total, builder.Build(), options...)
}
// AddFiller creates a bar which renders itself by provided filler.
// If `total <= 0` triggering complete event by increment methods is disabled.
// Panics if *Progress instance is done, i.e. called after (*Progress).Wait().
func (p *Progress) AddFiller(total int64, filler BarFiller, options ...BarOption) *Bar {
// MustAdd creates a bar which renders itself by provided BarFiller.
// If `total <= 0` triggering complete event by increment methods is
// disabled. Panics if *Progress instance is done, i.e. called after
// (*Progress).Wait().
func (p *Progress) MustAdd(total int64, filler BarFiller, options ...BarOption) *Bar {
bar, err := p.Add(total, filler, options...)
if err != nil {
panic(err)
}
return bar
}
// Add creates a bar which renders itself by provided BarFiller.
// If `total <= 0` triggering complete event by increment methods
// is disabled. If *Progress instance is done, i.e. called after
// (*Progress).Wait(), return error == DoneError.
func (p *Progress) Add(total int64, filler BarFiller, options ...BarOption) (*Bar, error) {
if filler == nil {
filler = NopStyle().Build()
}
@ -168,9 +181,9 @@ func (p *Progress) AddFiller(total int64, filler BarFiller, options ...BarOption
bs.shutdownListeners = append(bs.shutdownListeners, d)
}
})
return bar
return bar, nil
case <-p.done:
panic(DoneError)
return nil, DoneError
}
}