MCPcopy
hub / github.com/pterm/pterm / Fail

Method Fail

spinner_printer.go:254–267  ·  view source on GitHub ↗

Fail displays the fail printer. If no message is given, the text of the SpinnerPrinter will be reused as the default message.

(message ...any)

Source from the content-addressed store, hash-verified

252// Fail displays the fail printer.
253// If no message is given, the text of the SpinnerPrinter will be reused as the default message.
254func (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.

Callers 6

TestSpinnerPrinter_FailFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 4

StopMethod · 0.95
fClearLineFunction · 0.85
FprintoFunction · 0.85
SprintMethod · 0.65

Tested by 3

TestSpinnerPrinter_FailFunction · 0.64