File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,11 +14,10 @@ type loadingText struct {
1414 Stream io.Writer
1515 Message string
1616
17- startTimestamp int64
18- loadingRune int
19- isShown bool
20- stopChan chan bool
21- stopConfirmedChan chan bool
17+ startTimestamp int64
18+ loadingRune int
19+ isShown bool
20+ stopChan chan bool
2221}
2322
2423func (l * loadingText ) Start () {
@@ -28,17 +27,13 @@ func (l *loadingText) Start() {
2827 if l .stopChan == nil {
2928 l .stopChan = make (chan bool )
3029 }
31- if l .stopConfirmedChan == nil {
32- l .stopConfirmedChan = make (chan bool )
33- }
3430
3531 go func () {
3632 l .render ()
3733
3834 for {
3935 select {
4036 case <- l .stopChan :
41- l .stopConfirmedChan <- true
4237 return
4338 case <- time .After (waitInterval ):
4439 l .render ()
@@ -87,7 +82,6 @@ func (l *loadingText) render() {
8782
8883func (l * loadingText ) Stop () {
8984 l .stopChan <- true
90- <- l .stopConfirmedChan
9185 l .Stream .Write ([]byte ("\r " ))
9286
9387 messageLength := len (l .Message ) + 20
You can’t perform that action at this time.
0 commit comments