Codebase list golang-github-vbauerster-mpb / 58a1e7d
bump major version to v7 Vladimir Bauer 5 years ago
17 changed file(s) with 47 addition(s) and 50 deletion(s). Raw diff Collapse all Expand all
1111
1212 "github.com/acarl005/stripansi"
1313 "github.com/mattn/go-runewidth"
14 "github.com/vbauerster/mpb/v6/decor"
14 "github.com/vbauerster/mpb/v7/decor"
1515 )
1616
1717 // Bar represents a progress bar.
22 import (
33 "io"
44
5 "github.com/vbauerster/mpb/v6/decor"
5 "github.com/vbauerster/mpb/v7/decor"
66 )
77
88 // BarFiller interface.
55
66 "github.com/acarl005/stripansi"
77 "github.com/mattn/go-runewidth"
8 "github.com/vbauerster/mpb/v6/decor"
9 "github.com/vbauerster/mpb/v6/internal"
8 "github.com/vbauerster/mpb/v7/decor"
9 "github.com/vbauerster/mpb/v7/internal"
1010 )
1111
1212 const (
55
66 "github.com/acarl005/stripansi"
77 "github.com/mattn/go-runewidth"
8 "github.com/vbauerster/mpb/v6/decor"
9 "github.com/vbauerster/mpb/v6/internal"
8 "github.com/vbauerster/mpb/v7/decor"
9 "github.com/vbauerster/mpb/v7/internal"
1010 )
1111
1212 const (
33 "bytes"
44 "io"
55
6 "github.com/vbauerster/mpb/v6/decor"
7 "github.com/vbauerster/mpb/v6/internal"
6 "github.com/vbauerster/mpb/v7/decor"
7 "github.com/vbauerster/mpb/v7/internal"
88 )
99
1010 // BarOption is a func option to alter default behavior of a bar.
99 "time"
1010 "unicode/utf8"
1111
12 "github.com/vbauerster/mpb/v6"
13 "github.com/vbauerster/mpb/v6/decor"
12 "github.com/vbauerster/mpb/v7"
13 "github.com/vbauerster/mpb/v7/decor"
1414 )
1515
1616 func TestBarCompleted(t *testing.T) {
33 "io/ioutil"
44 "testing"
55
6 "github.com/vbauerster/mpb/v6/decor"
6 "github.com/vbauerster/mpb/v7/decor"
77 )
88
99 func BenchmarkIncrSingleBar(b *testing.B) {
55 "sync"
66 "time"
77
8 "github.com/vbauerster/mpb/v6/internal"
8 "github.com/vbauerster/mpb/v7/internal"
99 )
1010
1111 // ContainerOption is a func option to alter default behavior of a bar
0 // Package decor provides common decorators for "github.com/vbauerster/mpb/v6" module.
1 /*
2 Some decorators returned by this package might have a closure state. It is ok to use
3 decorators concurrently, unless you share the same decorator among multiple
4 *mpb.Bar instances. To avoid data races, create new decorator per *mpb.Bar instance.
5
6 Don't:
7
8 p := mpb.New()
9 name := decor.Name("bar")
10 p.AddBar(100, mpb.AppendDecorators(name))
11 p.AddBar(100, mpb.AppendDecorators(name))
12
13 Do:
14
15 p := mpb.New()
16 p.AddBar(100, mpb.AppendDecorators(decor.Name("bar1")))
17 p.AddBar(100, mpb.AppendDecorators(decor.Name("bar2")))
18 */
0 // Package decor provides common decorators for "github.com/vbauerster/mpb/v7" module.
1 //
2 // Some decorators returned by this package might have a closure state. It is ok to use
3 // decorators concurrently, unless you share the same decorator among multiple
4 // *mpb.Bar instances. To avoid data races, create new decorator per *mpb.Bar instance.
5 //
6 // Don't:
7 //
8 // p := mpb.New()
9 // name := decor.Name("bar")
10 // p.AddBar(100, mpb.AppendDecorators(name))
11 // p.AddBar(100, mpb.AppendDecorators(name))
12 //
13 // Do:
14 //
15 // p := mpb.New()
16 // p.AddBar(100, mpb.AppendDecorators(decor.Name("bar1")))
17 // p.AddBar(100, mpb.AppendDecorators(decor.Name("bar2")))
1918 package decor
44 "io"
55 "strconv"
66
7 "github.com/vbauerster/mpb/v6/internal"
7 "github.com/vbauerster/mpb/v7/internal"
88 )
99
1010 type percentageType float64
33 "sync"
44 "testing"
55
6 "github.com/vbauerster/mpb/v6"
7 "github.com/vbauerster/mpb/v6/decor"
6 "github.com/vbauerster/mpb/v7"
7 "github.com/vbauerster/mpb/v7/decor"
88 )
99
1010 func TestNameDecorator(t *testing.T) {
66 "math/rand"
77 "time"
88
9 "github.com/vbauerster/mpb/v6"
10 "github.com/vbauerster/mpb/v6/decor"
9 "github.com/vbauerster/mpb/v7"
10 "github.com/vbauerster/mpb/v7/decor"
1111 )
1212
1313 func Example() {
0 module github.com/vbauerster/mpb/v6
0 module github.com/vbauerster/mpb/v7
11
22 require (
33 github.com/VividCortex/ewma v1.2.0
44 github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
5 github.com/mattn/go-runewidth v0.0.12
6 github.com/rivo/uniseg v0.2.0
7 golang.org/x/sys v0.0.0-20210514084401-e8d321eab015
5 github.com/mattn/go-runewidth v0.0.13
6 golang.org/x/sys v0.0.0-20210521203332-0cec03c779c1
87 )
98
109 go 1.14
11 github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
22 github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
33 github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=
4 github.com/mattn/go-runewidth v0.0.12 h1:Y41i/hVW3Pgwr8gV+J23B9YEY0zxjptBuCWEaxmAOow=
5 github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
6 github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
4 github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
5 github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
76 github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
87 github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
9 golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 h1:hZR0X1kPW+nwyJ9xRxqZk1vx5RUObAPBdKVvXPDUH/E=
10 golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8 golang.org/x/sys v0.0.0-20210521203332-0cec03c779c1 h1:lCnv+lfrU9FRPGf8NeRuWAAPjNnema5WtBinMgs1fD8=
9 golang.org/x/sys v0.0.0-20210521203332-0cec03c779c1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1212 "sync"
1313 "time"
1414
15 "github.com/vbauerster/mpb/v6/cwriter"
16 "github.com/vbauerster/mpb/v6/decor"
15 "github.com/vbauerster/mpb/v7/cwriter"
16 "github.com/vbauerster/mpb/v7/decor"
1717 )
1818
1919 const (
88 "testing"
99 "time"
1010
11 "github.com/vbauerster/mpb/v6"
12 "github.com/vbauerster/mpb/v6/decor"
11 "github.com/vbauerster/mpb/v7"
12 "github.com/vbauerster/mpb/v7/decor"
1313 )
1414
1515 func init() {
66 "strings"
77 "testing"
88
9 "github.com/vbauerster/mpb/v6"
9 "github.com/vbauerster/mpb/v7"
1010 )
1111
1212 const content = `Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do