summaryrefslogtreecommitdiff
path: root/vendor/github.com/vbauerster/mpb/v7/proxyreader.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/vbauerster/mpb/v7/proxyreader.go')
-rw-r--r--vendor/github.com/vbauerster/mpb/v7/proxyreader.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/vendor/github.com/vbauerster/mpb/v7/proxyreader.go b/vendor/github.com/vbauerster/mpb/v7/proxyreader.go
index 25f195bb8..b0dd89d45 100644
--- a/vendor/github.com/vbauerster/mpb/v7/proxyreader.go
+++ b/vendor/github.com/vbauerster/mpb/v7/proxyreader.go
@@ -14,9 +14,6 @@ type proxyReader struct {
func (x proxyReader) Read(p []byte) (int, error) {
n, err := x.ReadCloser.Read(p)
x.bar.IncrBy(n)
- if err == io.EOF {
- go x.bar.SetTotal(-1, true)
- }
return n, err
}
@@ -28,9 +25,6 @@ type proxyWriterTo struct {
func (x proxyWriterTo) WriteTo(w io.Writer) (int64, error) {
n, err := x.wt.WriteTo(w)
x.bar.IncrInt64(n)
- if err == io.EOF {
- go x.bar.SetTotal(-1, true)
- }
return n, err
}
@@ -65,12 +59,12 @@ func (b *Bar) newProxyReader(r io.Reader) (rc io.ReadCloser) {
pr := proxyReader{toReadCloser(r), b}
if wt, ok := r.(io.WriterTo); ok {
pw := proxyWriterTo{pr, wt}
- if b.hasEwmaDecorators {
+ if b.hasEwma {
rc = ewmaProxyWriterTo{ewmaProxyReader{pr}, pw}
} else {
rc = pw
}
- } else if b.hasEwmaDecorators {
+ } else if b.hasEwma {
rc = ewmaProxyReader{pr}
} else {
rc = pr