MCPcopy
hub / github.com/pterm/pterm / Printfln

Method Printfln

prefix_printer.go:289–299  ·  view source on GitHub ↗

Printfln formats according to a format specifier and writes to standard output. Spaces are always added between operands and a newline is appended. It returns the number of bytes written and any write error encountered.

(format string, a ...any)

Source from the content-addressed store, hash-verified

287// Spaces are always added between operands and a newline is appended.
288// It returns the number of bytes written and any write error encountered.
289func (p *PrefixPrinter) Printfln(format string, a ...any) *TextPrinter {
290 tp := TextPrinter(p)
291 if p.Debugger && !PrintDebugMessages {
292 return &tp
293 }
294 p.LineNumberOffset++
295 Fprint(p.GetWriter(), p.Sprintfln(format, a...))
296 p.LineNumberOffset--
297 checkFatal(p)
298 return &tp
299}
300
301// PrintOnError prints every error which is not nil.
302// If every error is nil, nothing will be printed.

Callers

nothing calls this directly

Calls 5

GetWriterMethod · 0.95
SprintflnMethod · 0.95
TextPrinterInterface · 0.85
FprintFunction · 0.85
checkFatalFunction · 0.85

Tested by

no test coverage detected