Update progressbar library, use it's option to clear progress after finish

This commit is contained in:
2019-04-02 00:42:25 +04:00
parent 984f509780
commit bbce2369b4
8 changed files with 33 additions and 12 deletions

View File

@@ -124,6 +124,7 @@ func uploadFile(uploadPath string, filePath string, overwriteFile bool) {
int(fileInfo.Size()),
progressbar.OptionSetBytes(int(fileInfo.Size())),
progressbar.OptionSetRenderBlankState(true),
progressbar.OptionClearOnFinish(),
)
progressReader := &progressReader{

View File

@@ -4,7 +4,6 @@
package yandexv1
import (
"fmt"
"github.com/schollz/progressbar/v2"
"io"
)
@@ -26,9 +25,6 @@ func (pr *progressReader) Read(p []byte) (int, error) {
func (pr *progressReader) report(n int64) {
_ = pr.progressbar.Add64(n)
if pr.atEOF {
fmt.Print("\n\n")
}
}
type TokenError struct {