Fix spinner

This commit is contained in:
Marcin Kulik
2016-02-21 18:22:37 +01:00
parent caff3970f8
commit 13a8653ce4

View File

@@ -12,7 +12,11 @@ func WithSpinner(delay int, f func()) {
stopChan := make(chan struct{}) stopChan := make(chan struct{})
go func() { go func() {
<-time.After(time.Duration(delay) * time.Millisecond) select {
case <-stopChan:
return
case <-time.After(time.Duration(delay) * time.Millisecond):
}
i := 0 i := 0
fmt.Fprintf(os.Stdout, "\x1b[?25l") // hide cursor fmt.Fprintf(os.Stdout, "\x1b[?25l") // hide cursor