]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/progress.go
Log handler's stdout/stderr
[nncp.git] / src / progress.go
index 945c57526419a2166cb20d3ea27057eff844da8b..5ebc72bdb20b2e16df5ba53ed33bf0669f5a13b5 100644 (file)
@@ -25,7 +25,7 @@ import (
        "time"
 
        "github.com/dustin/go-humanize"
-       "go.cypherpunks.ru/nncp/v6/uilive"
+       "go.cypherpunks.ru/nncp/v7/uilive"
 )
 
 func init() {
@@ -132,9 +132,9 @@ func Progress(prefix string, les LEs) {
                }
        }
        progressBarsLock.RLock()
-       pb, exists := progressBars[pkt]
+       pb := progressBars[pkt]
        progressBarsLock.RUnlock()
-       if !exists {
+       if pb == nil {
                progressBarsLock.Lock()
                pb = ProgressBarNew(size, fullsize)
                progressBars[pkt] = pb
@@ -156,8 +156,8 @@ func Progress(prefix string, les LEs) {
 
 func ProgressKill(pkt string) {
        progressBarsLock.Lock()
-       pb, exists := progressBars[pkt]
-       if exists {
+       pb := progressBars[pkt]
+       if pb != nil {
                pb.Kill()
                delete(progressBars, pkt)
        }