Fail displays the fail printer. If no message is given, the text of the SpinnerPrinter will be reused as the default message.
(message ...any)
| 252 | // Fail displays the fail printer. |
| 253 | // If no message is given, the text of the SpinnerPrinter will be reused as the default message. |
| 254 | func (s *SpinnerPrinter) Fail(message ...any) { |
| 255 | if s.FailPrinter == nil { |
| 256 | s.FailPrinter = &Error |
| 257 | } |
| 258 | |
| 259 | if len(message) == 0 { |
| 260 | message = []any{s.Text} |
| 261 | } |
| 262 | |
| 263 | fClearLine(s.Writer) |
| 264 | |
| 265 | Fprinto(s.Writer, s.FailPrinter.Sprint(message...)) |
| 266 | _ = s.Stop() |
| 267 | } |
| 268 | |
| 269 | // Warning displays the warning printer. |
| 270 | // If no message is given, the text of the SpinnerPrinter will be reused as the default message. |