mirror of
https://github.com/minio/minio.git
synced 2024-12-27 15:45:55 -05:00
4ab57f7d60
Some environments might disable access to `/dev/tty`, fall back to '80' in such scenarios. Move to 'cheggaaa/pb' package for better cross platform support on fetching terminal width. Fixes #1891
18 lines
229 B
Go
18 lines
229 B
Go
package pb
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
// It's proxy reader, implement io.Reader
|
|
type Reader struct {
|
|
io.Reader
|
|
bar *ProgressBar
|
|
}
|
|
|
|
func (r *Reader) Read(p []byte) (n int, err error) {
|
|
n, err = r.Reader.Read(p)
|
|
r.bar.Add(n)
|
|
return
|
|
}
|