diff --git a/bar.go b/bar.go index f4b52e0..93ac0a2 100644 --- a/bar.go +++ b/bar.go @@ -138,7 +138,7 @@ // TraverseDecorators traverses all available decorators and calls cb func on each. func (b *Bar) TraverseDecorators(cb func(decor.Decorator)) { - done := make(chan struct{}) + sync := make(chan struct{}) select { case b.operateState <- func(s *bState) { for _, decorators := range [...][]decor.Decorator{ @@ -149,9 +149,9 @@ cb(extractBaseDecorator(d)) } } - close(done) - }: - <-done + close(sync) + }: + <-sync case <-b.done: } } diff --git a/progress.go b/progress.go index 075832e..1d9a53e 100644 --- a/progress.go +++ b/progress.go @@ -136,7 +136,7 @@ } func (p *Progress) traverseBars(cb func(b *Bar) bool) { - done := make(chan struct{}) + sync := make(chan struct{}) select { case p.operateState <- func(s *pState) { for i := 0; i < s.bHeap.Len(); i++ { @@ -145,9 +145,9 @@ break } } - close(done) + close(sync) }: - <-done + <-sync case <-p.done: } }