mod v6
Vladimir Bauer
5 years ago
| 25 | 25 |
"math/rand"
|
| 26 | 26 |
"time"
|
| 27 | 27 |
|
| 28 | |
"github.com/vbauerster/mpb/v5"
|
| 29 | |
"github.com/vbauerster/mpb/v5/decor"
|
|
28 |
"github.com/vbauerster/mpb/v6"
|
|
29 |
"github.com/vbauerster/mpb/v6/decor"
|
| 30 | 30 |
)
|
| 31 | 31 |
|
| 32 | 32 |
func main() {
|
| 11 | 11 |
|
| 12 | 12 |
"github.com/acarl005/stripansi"
|
| 13 | 13 |
"github.com/mattn/go-runewidth"
|
| 14 | |
"github.com/vbauerster/mpb/v5/decor"
|
|
14 |
"github.com/vbauerster/mpb/v6/decor"
|
| 15 | 15 |
)
|
| 16 | 16 |
|
| 17 | 17 |
// Bar represents a progress Bar.
|
| 2 | 2 |
import (
|
| 3 | 3 |
"io"
|
| 4 | 4 |
|
| 5 | |
"github.com/vbauerster/mpb/v5/decor"
|
|
5 |
"github.com/vbauerster/mpb/v6/decor"
|
| 6 | 6 |
)
|
| 7 | 7 |
|
| 8 | 8 |
// BarFiller interface.
|
| 5 | 5 |
"unicode/utf8"
|
| 6 | 6 |
|
| 7 | 7 |
"github.com/mattn/go-runewidth"
|
| 8 | |
"github.com/vbauerster/mpb/v5/decor"
|
| 9 | |
"github.com/vbauerster/mpb/v5/internal"
|
|
8 |
"github.com/vbauerster/mpb/v6/decor"
|
|
9 |
"github.com/vbauerster/mpb/v6/internal"
|
| 10 | 10 |
)
|
| 11 | 11 |
|
| 12 | 12 |
const (
|
| 4 | 4 |
"strings"
|
| 5 | 5 |
|
| 6 | 6 |
"github.com/mattn/go-runewidth"
|
| 7 | |
"github.com/vbauerster/mpb/v5/decor"
|
| 8 | |
"github.com/vbauerster/mpb/v5/internal"
|
|
7 |
"github.com/vbauerster/mpb/v6/decor"
|
|
8 |
"github.com/vbauerster/mpb/v6/internal"
|
| 9 | 9 |
)
|
| 10 | 10 |
|
| 11 | 11 |
// SpinnerAlignment enum.
|
| 3 | 3 |
"bytes"
|
| 4 | 4 |
"io"
|
| 5 | 5 |
|
| 6 | |
"github.com/vbauerster/mpb/v5/decor"
|
| 7 | |
"github.com/vbauerster/mpb/v5/internal"
|
|
6 |
"github.com/vbauerster/mpb/v6/decor"
|
|
7 |
"github.com/vbauerster/mpb/v6/internal"
|
| 8 | 8 |
)
|
| 9 | 9 |
|
| 10 | 10 |
// BarOption is a function option which changes the default behavior of a bar.
|
| 9 | 9 |
"time"
|
| 10 | 10 |
"unicode/utf8"
|
| 11 | 11 |
|
| 12 | |
"github.com/vbauerster/mpb/v5"
|
| 13 | |
"github.com/vbauerster/mpb/v5/decor"
|
|
12 |
"github.com/vbauerster/mpb/v6"
|
|
13 |
"github.com/vbauerster/mpb/v6/decor"
|
| 14 | 14 |
)
|
| 15 | 15 |
|
| 16 | 16 |
func TestBarCompleted(t *testing.T) {
|
| 3 | 3 |
"io/ioutil"
|
| 4 | 4 |
"testing"
|
| 5 | 5 |
|
| 6 | |
"github.com/vbauerster/mpb/v5/decor"
|
|
6 |
"github.com/vbauerster/mpb/v6/decor"
|
| 7 | 7 |
)
|
| 8 | 8 |
|
| 9 | 9 |
func BenchmarkIncrSingleBar(b *testing.B) {
|
| 5 | 5 |
"sync"
|
| 6 | 6 |
"time"
|
| 7 | 7 |
|
| 8 | |
"github.com/vbauerster/mpb/v5/internal"
|
|
8 |
"github.com/vbauerster/mpb/v6/internal"
|
| 9 | 9 |
)
|
| 10 | 10 |
|
| 11 | 11 |
// ContainerOption is a function option which changes the default
|
| 0 | 0 |
/*
|
| 1 | |
Package decor provides common decorators for "github.com/vbauerster/mpb/v5" module.
|
|
1 |
Package decor provides common decorators for "github.com/vbauerster/mpb/v6" module.
|
| 2 | 2 |
|
| 3 | 3 |
Some decorators returned by this package might have a closure state. It is ok to use
|
| 4 | 4 |
decorators concurrently, unless you share the same decorator among multiple
|
| 4 | 4 |
"io"
|
| 5 | 5 |
"strconv"
|
| 6 | 6 |
|
| 7 | |
"github.com/vbauerster/mpb/v5/internal"
|
|
7 |
"github.com/vbauerster/mpb/v6/internal"
|
| 8 | 8 |
)
|
| 9 | 9 |
|
| 10 | 10 |
type percentageType float64
|
| 3 | 3 |
"sync"
|
| 4 | 4 |
"testing"
|
| 5 | 5 |
|
| 6 | |
"github.com/vbauerster/mpb/v5"
|
| 7 | |
"github.com/vbauerster/mpb/v5/decor"
|
|
6 |
"github.com/vbauerster/mpb/v6"
|
|
7 |
"github.com/vbauerster/mpb/v6/decor"
|
| 8 | 8 |
)
|
| 9 | 9 |
|
| 10 | 10 |
func TestNameDecorator(t *testing.T) {
|
| 6 | 6 |
"math/rand"
|
| 7 | 7 |
"time"
|
| 8 | 8 |
|
| 9 | |
"github.com/vbauerster/mpb/v5"
|
| 10 | |
"github.com/vbauerster/mpb/v5/decor"
|
|
9 |
"github.com/vbauerster/mpb/v6"
|
|
10 |
"github.com/vbauerster/mpb/v6/decor"
|
| 11 | 11 |
)
|
| 12 | 12 |
|
| 13 | 13 |
func Example() {
|
| 0 | |
module github.com/vbauerster/mpb/v5
|
|
0 |
module github.com/vbauerster/mpb/v6
|
| 1 | 1 |
|
| 2 | 2 |
require (
|
| 3 | 3 |
github.com/VividCortex/ewma v1.1.1
|
| 12 | 12 |
"sync"
|
| 13 | 13 |
"time"
|
| 14 | 14 |
|
| 15 | |
"github.com/vbauerster/mpb/v5/cwriter"
|
| 16 | |
"github.com/vbauerster/mpb/v5/decor"
|
|
15 |
"github.com/vbauerster/mpb/v6/cwriter"
|
|
16 |
"github.com/vbauerster/mpb/v6/decor"
|
| 17 | 17 |
)
|
| 18 | 18 |
|
| 19 | 19 |
const (
|
| 8 | 8 |
"testing"
|
| 9 | 9 |
"time"
|
| 10 | 10 |
|
| 11 | |
"github.com/vbauerster/mpb/v5"
|
| 12 | |
"github.com/vbauerster/mpb/v5/decor"
|
|
11 |
"github.com/vbauerster/mpb/v6"
|
|
12 |
"github.com/vbauerster/mpb/v6/decor"
|
| 13 | 13 |
)
|
| 14 | 14 |
|
| 15 | 15 |
func init() {
|
| 6 | 6 |
"strings"
|
| 7 | 7 |
"testing"
|
| 8 | 8 |
|
| 9 | |
"github.com/vbauerster/mpb/v5"
|
|
9 |
"github.com/vbauerster/mpb/v6"
|
| 10 | 10 |
)
|
| 11 | 11 |
|
| 12 | 12 |
const content = `Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
|