@@ -29,7 +29,7 @@ type Bar struct {
2929 trimLeftCh chan bool
3030 trimRightCh chan bool
3131 refillCh chan * refill
32- decoratorCh chan * decorator
32+ dCommandCh chan * dCommandData
3333 flushedCh chan struct {}
3434 removeReqCh chan struct {}
3535 completeReqCh chan struct {}
@@ -89,7 +89,7 @@ func newBar(id int, total int64, width int, format string, wg *sync.WaitGroup, c
8989 trimLeftCh : make (chan bool ),
9090 trimRightCh : make (chan bool ),
9191 refillCh : make (chan * refill ),
92- decoratorCh : make (chan * decorator ),
92+ dCommandCh : make (chan * dCommandData ),
9393 flushedCh : make (chan struct {}, 1 ),
9494 removeReqCh : make (chan struct {}),
9595 completeReqCh : make (chan struct {}),
@@ -212,7 +212,7 @@ func (b *Bar) PrependFunc(f DecoratorFunc) *Bar {
212212 if isClosed (b .done ) {
213213 return b
214214 }
215- b .decoratorCh <- & decorator { decPrepend , f }
215+ b .dCommandCh <- & dCommandData { dPrepend , f }
216216 return b
217217}
218218
@@ -221,15 +221,15 @@ func (b *Bar) RemoveAllPrependers() {
221221 if isClosed (b .done ) {
222222 return
223223 }
224- b .decoratorCh <- & decorator { decPrependZero , nil }
224+ b .dCommandCh <- & dCommandData { dPrependZero , nil }
225225}
226226
227227// AppendFunc appends DecoratorFunc
228228func (b * Bar ) AppendFunc (f DecoratorFunc ) * Bar {
229229 if isClosed (b .done ) {
230230 return b
231231 }
232- b .decoratorCh <- & decorator { decAppend , f }
232+ b .dCommandCh <- & dCommandData { dAppend , f }
233233 return b
234234}
235235
@@ -238,7 +238,7 @@ func (b *Bar) RemoveAllAppenders() {
238238 if isClosed (b .done ) {
239239 return
240240 }
241- b .decoratorCh <- & decorator { decAppendZero , nil }
241+ b .dCommandCh <- & dCommandData { dAppendZero , nil }
242242}
243243
244244// Completed signals to the bar, that process has been completed.
@@ -298,15 +298,15 @@ func (b *Bar) server(id int, total int64, width int, format string, wg *sync.Wai
298298 }
299299 barState .current = n
300300 prevStartTime = blockStartTime
301- case d := <- b .decoratorCh :
302- switch d . kind {
303- case decAppend :
304- barState .appendFuncs = append (barState .appendFuncs , d .f )
305- case decAppendZero :
301+ case data := <- b .dCommandCh :
302+ switch data . action {
303+ case dAppend :
304+ barState .appendFuncs = append (barState .appendFuncs , data .f )
305+ case dAppendZero :
306306 barState .appendFuncs = nil
307- case decPrepend :
308- barState .prependFuncs = append (barState .prependFuncs , d .f )
309- case decPrependZero :
307+ case dPrepend :
308+ barState .prependFuncs = append (barState .prependFuncs , data .f )
309+ case dPrependZero :
310310 barState .prependFuncs = nil
311311 }
312312 case ch := <- b .stateReqCh :
0 commit comments