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
I am trying to use spinner and the spinner keep printing stdout line by line instead of refreshing:
Please enter your username: asd
⠋ Loggin into platform as asd...
⠙ Loggin into platform as asd...
⠚ Loggin into platform as asd...
⠒ Loggin into platform as asd...
⠂ Loggin into platform as asd...
⠂ Loggin into platform as asd...
⠒ Loggin into platform as asd...
⠲ Loggin into platform as asd...
⠴ Loggin into platform as asd...
⠦ Loggin into platform as asd...
⠖ Loggin into platform as asd...
Below attached my code, is it a normal behavior?
reader:=bufio.NewReader(os.Stdin)
fmt.Printf("Please enter your username: ")
username, _:=reader.ReadString('\n')
username=strings.TrimSuffix(username, "\n")
s:=spinner.New(spinner.CharSets[24], 100*time.Millisecond)
s.Suffix=fmt.Sprintf(" Loggin into platform as %s...\n", username)
s.Color("magenta")
s.FinalMSG=fmt.Sprintf("Successfully signed in as %s\n", username)
s.Start()
time.Sleep(2*time.Second)
s.Stop()
The text was updated successfully, but these errors were encountered:
I am trying to use spinner and the spinner keep printing stdout line by line instead of refreshing:
Below attached my code, is it a normal behavior?
The text was updated successfully, but these errors were encountered: