fix(deps): update module github.com/vbauerster/mpb/v8 to v8.10.1

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2025-05-13 15:58:27 +00:00
committed by GitHub
parent 76e11cf5fc
commit fe84fbae72
8 changed files with 44 additions and 64 deletions

2
go.mod
View File

@ -65,7 +65,7 @@ require (
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6
github.com/stretchr/testify v1.10.0
github.com/vbauerster/mpb/v8 v8.10.0
github.com/vbauerster/mpb/v8 v8.10.1
github.com/vishvananda/netlink v1.3.1
go.etcd.io/bbolt v1.4.0
golang.org/x/crypto v0.38.0

4
go.sum
View File

@ -479,8 +479,8 @@ github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/vbatts/tar-split v0.12.1 h1:CqKoORW7BUWBe7UL/iqTVvkTBOF8UvOMKOIZykxnnbo=
github.com/vbatts/tar-split v0.12.1/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA=
github.com/vbauerster/mpb/v8 v8.10.0 h1:5ZYEWM4ovaZGAibjzW4PlQNb5k+JpzMqVwgNyk+K0M8=
github.com/vbauerster/mpb/v8 v8.10.0/go.mod h1:DYPFebxSahB+f7tuEUGauLQ7w8ij3wMr4clsVuJCV4I=
github.com/vbauerster/mpb/v8 v8.10.1 h1:t/ZFv/NYgoBUy2LrmkD5Vc25r+JhoS4+gRkjVbolO2Y=
github.com/vbauerster/mpb/v8 v8.10.1/go.mod h1:+Ja4P92E3/CorSZgfDtK46D7AVbDqmBQRTmyTqPElo0=
github.com/vishvananda/netlink v1.3.1 h1:3AEMt62VKqz90r0tmNhog0r/PpWKmrEShJU0wJW6bV0=
github.com/vishvananda/netlink v1.3.1/go.mod h1:ARtKouGSTGchR8aMwmkzC0qiNPrrWO5JS/XMVl45+b4=
github.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zdEY=

View File

@ -104,14 +104,14 @@ func main() {
p.Wait()
```
#### [Dynamic total](_examples/dynTotal/main.go)
#### [dynTotal example](_examples/dynTotal/main.go)
![dynamic total](_svg/godEMrCZmJkHYH1X9dN4Nm0U7.svg)
![dynTotal](_svg/godEMrCZmJkHYH1X9dN4Nm0U7.svg)
#### [Complex example](_examples/complex/main.go)
#### [complex example](_examples/complex/main.go)
![complex](_svg/wHzf1M7sd7B3zVa2scBMnjqRf.svg)
#### [Bytes counters](_examples/io/main.go)
#### [io example](_examples/io/main.go)
![byte counters](_svg/hIpTa3A5rQz65ssiVuRJu87X6.svg)
![io](_svg/hIpTa3A5rQz65ssiVuRJu87X6.svg)

View File

@ -10,15 +10,15 @@ import (
const (
iLbound = iota
iRbound
iRefiller
iFiller
iTip
iPadding
iRbound
iLen
)
var defaultBarStyle = [iLen]string{"[", "]", "+", "=", ">", "-"}
var defaultBarStyle = [iLen]string{"[", "+", "=", ">", "-", "]"}
// BarStyleComposer interface.
type BarStyleComposer interface {
@ -86,9 +86,7 @@ func (s barStyle) Lbound(bound string) BarStyleComposer {
}
func (s barStyle) LboundMeta(fn func(string) string) BarStyleComposer {
if fn != nil && len(fn("")) != 0 {
s.metas[iLbound] = fn
}
return s
}
@ -98,9 +96,7 @@ func (s barStyle) Rbound(bound string) BarStyleComposer {
}
func (s barStyle) RboundMeta(fn func(string) string) BarStyleComposer {
if fn != nil && len(fn("")) != 0 {
s.metas[iRbound] = fn
}
return s
}
@ -110,9 +106,7 @@ func (s barStyle) Filler(filler string) BarStyleComposer {
}
func (s barStyle) FillerMeta(fn func(string) string) BarStyleComposer {
if fn != nil && len(fn("")) != 0 {
s.metas[iFiller] = fn
}
return s
}
@ -122,9 +116,7 @@ func (s barStyle) Refiller(refiller string) BarStyleComposer {
}
func (s barStyle) RefillerMeta(fn func(string) string) BarStyleComposer {
if fn != nil && len(fn("")) != 0 {
s.metas[iRefiller] = fn
}
return s
}
@ -134,9 +126,7 @@ func (s barStyle) Padding(padding string) BarStyleComposer {
}
func (s barStyle) PaddingMeta(fn func(string) string) BarStyleComposer {
if fn != nil && len(fn("")) != 0 {
s.metas[iPadding] = fn
}
return s
}
@ -148,9 +138,7 @@ func (s barStyle) Tip(frames ...string) BarStyleComposer {
}
func (s barStyle) TipMeta(fn func(string) string) BarStyleComposer {
if fn != nil && len(fn("")) != 0 {
s.metas[iTip] = fn
}
return s
}
@ -247,11 +235,11 @@ func (s *barFiller) Fill(w io.Writer, stat decor.Statistics) error {
return s.flushOp(barSections{
{s.metas[iLbound], s.components[iLbound].bytes},
{s.metas[iRbound], s.components[iRbound].bytes},
{s.metas[iRefiller], refilling},
{s.metas[iFiller], filling},
{s.metas[iTip], tip.bytes},
{s.metas[iPadding], padding},
{s.metas[iRbound], s.components[iRbound].bytes},
}, w)
}
@ -265,30 +253,22 @@ func (s barSection) flush(w io.Writer) (err error) {
}
func (bb barSections) flush(w io.Writer) error {
err := bb[0].flush(w)
if err != nil {
return err
}
for _, s := range bb[2:] {
for _, s := range bb {
err := s.flush(w)
if err != nil {
return err
}
}
return bb[1].flush(w)
return nil
}
func (bb barSections) flushRev(w io.Writer) error {
err := bb[0].flush(w)
if err != nil {
return err
}
ss := bb[2:]
for i := len(ss) - 1; i >= 0; i-- {
err := ss[i].flush(w)
bb[0], bb[len(bb)-1] = bb[len(bb)-1], bb[0]
for i := len(bb) - 1; i >= 0; i-- {
err := bb[i].flush(w)
if err != nil {
return err
}
}
return bb[1].flush(w)
return nil
}

View File

@ -40,7 +40,7 @@ type spinnerStyle struct {
// SpinnerStyle constructs default spinner style which can be altered via
// SpinnerStyleComposer interface.
func SpinnerStyle(frames ...string) SpinnerStyleComposer {
ss := spinnerStyle{meta: func(s string) string { return s }}
var ss spinnerStyle
if len(frames) != 0 {
ss.frames = frames
} else {
@ -60,17 +60,12 @@ func (s spinnerStyle) PositionRight() SpinnerStyleComposer {
}
func (s spinnerStyle) Meta(fn func(string) string) SpinnerStyleComposer {
if fn != nil && len(fn("")) != 0 {
s.meta = fn
}
return s
}
func (s spinnerStyle) Build() BarFiller {
sf := &spinnerFiller{
frames: s.frames,
meta: s.meta,
}
sf := &spinnerFiller{frames: s.frames}
switch s.position {
case positionLeft:
sf.position = func(frame string, padWidth int) string {
@ -85,6 +80,11 @@ func (s spinnerStyle) Build() BarFiller {
return strings.Repeat(" ", padWidth/2) + frame + strings.Repeat(" ", padWidth/2+padWidth%2)
}
}
if s.meta != nil {
sf.meta = s.meta
} else {
sf.meta = func(s string) string { return s }
}
return sf
}

View File

@ -41,7 +41,7 @@ func (m heapManager) run() {
var bHeap priorityQueue
var pMatrix, aMatrix map[int][]chan int
var len int
var l int
var sync bool
for req := range m {
@ -51,7 +51,7 @@ func (m heapManager) run() {
heap.Push(&bHeap, data.bar)
sync = sync || data.sync
case h_sync:
if sync || len != bHeap.Len() {
if sync || l != bHeap.Len() {
pMatrix = make(map[int][]chan int)
aMatrix = make(map[int][]chan int)
for _, b := range bHeap {
@ -64,7 +64,7 @@ func (m heapManager) run() {
}
}
sync = false
len = bHeap.Len()
l = bHeap.Len()
}
drop := req.data.(<-chan struct{})
syncWidth(pMatrix, drop)
@ -106,7 +106,7 @@ func (m heapManager) run() {
}
case h_state:
ch := req.data.(chan<- bool)
ch <- sync || len != bHeap.Len()
ch <- sync || l != bHeap.Len()
case h_end:
ch := req.data.(chan<- interface{})
if ch != nil {

View File

@ -20,18 +20,18 @@ func (pq priorityQueue) Swap(i, j int) {
}
func (pq *priorityQueue) Push(x interface{}) {
n := len(*pq)
s := *pq
bar := x.(*Bar)
bar.index = n
*pq = append(*pq, bar)
bar.index = len(s)
*pq = append(s, bar)
}
func (pq *priorityQueue) Pop() interface{} {
old := *pq
n := len(old)
bar := old[n-1]
old[n-1] = nil // avoid memory leak
s := *pq
l := len(s)
bar := s[l-1]
bar.index = -1 // for safety
*pq = old[:n-1]
s[l-1] = nil // avoid memory leak
*pq = s[:l-1]
return bar
}

2
vendor/modules.txt vendored
View File

@ -990,7 +990,7 @@ github.com/ulikunitz/xz/lzma
github.com/vbatts/tar-split/archive/tar
github.com/vbatts/tar-split/tar/asm
github.com/vbatts/tar-split/tar/storage
# github.com/vbauerster/mpb/v8 v8.10.0
# github.com/vbauerster/mpb/v8 v8.10.1
## explicit; go 1.23.0
github.com/vbauerster/mpb/v8
github.com/vbauerster/mpb/v8/cwriter