diff --git a/bar.go b/bar.go index 6521ffc..b5c08f9 100644 --- a/bar.go +++ b/bar.go @@ -28,7 +28,6 @@ // Bar represents a progress Bar type Bar struct { - incrCh chan incrReq completeReqCh chan struct{} done chan struct{} inProgress chan struct{} @@ -39,16 +38,10 @@ state state } -// Refil is a struct for b.IncrWithReFill -type refill struct { - char rune - till int64 -} - type ( - incrReq struct { - amount int64 - refill *refill + refill struct { + char rune + till int64 } state struct { id int @@ -87,7 +80,6 @@ } b := &Bar{ - incrCh: make(chan incrReq), completeReqCh: make(chan struct{}), done: make(chan struct{}), inProgress: make(chan struct{}), @@ -229,7 +221,8 @@ b.Complete() } }: - default: + case <-time.After(prr): + return } }