UpdateText updates the message of the active SpinnerPrinter. Can be used live.
(text string)
| 136 | // UpdateText updates the message of the active SpinnerPrinter. |
| 137 | // Can be used live. |
| 138 | func (s *SpinnerPrinter) UpdateText(text string) { |
| 139 | s.Text = text |
| 140 | if !RawOutput { |
| 141 | Fprinto(s.Writer, "\033[K"+s.Style.Sprint(s.currentSequence)+" "+s.MessageStyle.Sprint(s.Text)) |
| 142 | } else { |
| 143 | Fprintln(s.Writer, s.Text) |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | // Start the SpinnerPrinter. |
| 148 | func (s SpinnerPrinter) Start(text ...any) (*SpinnerPrinter, error) { |