You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"fmt"
"time"
"github.com/briandowns/spinner"
)
func main() {
mySpinner := spinner.New(spinner.CharSets[11], 100 * time.Millisecond)
mySpinner.Suffix = " Starting spinner"
mySpinner.Start()
time.Sleep(500 * time.Millisecond)
i := 0
for {
mySpinner.Stop()
fmt.Printf("This is message #%d\n", i)
mySpinner.Restart()
i += 1
time.Sleep(500 * time.Millisecond)
}
}
The expected behavior is that the fmt.Printf(...) lines are printed one by one, with just the spinner running below it. However, after some time (usually less than printing 100 lines in my limited testing), the spinner no longer appears below the output of invocations of fmt.Printf(...) and all that appears is just the lines being printed.
I've also tried wrapping the Restart() call like so:
for ok := true; ok; ok = !mySpinner.Active() {
mySpinner.Restart()
}
but this doesn't seem to fix the issue - the execution proceeds without the spinner.
The text was updated successfully, but these errors were encountered:
@alebcay After seeing some of the challenges with this project I've created an alternative spinner, and have been trying to see if mine suffers from any of the same limitations as this one. I wanted to reach out to see if you might be willing to try my spinner to see if you can reproduce this issue there, and if so raise an issue: https://github.com/theckman/yacspin
Consider the following basic program:
The expected behavior is that the
fmt.Printf(...)
lines are printed one by one, with just the spinner running below it. However, after some time (usually less than printing 100 lines in my limited testing), the spinner no longer appears below the output of invocations offmt.Printf(...)
and all that appears is just the lines being printed.I've also tried wrapping the
Restart()
call like so:but this doesn't seem to fix the issue - the execution proceeds without the spinner.
The text was updated successfully, but these errors were encountered: