Update progressbar library, use it's option to clear progress after finish
This commit is contained in:
@@ -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{
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user