MCPcopy
hub / github.com/pterm/pterm / Printf

Method Printf

prefix_printer.go:276–284  ·  view source on GitHub ↗

Printf formats according to a format specifier and writes to standard output. It returns the number of bytes written and any write error encountered.

(format string, a ...any)

Source from the content-addressed store, hash-verified

274// Printf formats according to a format specifier and writes to standard output.
275// It returns the number of bytes written and any write error encountered.
276func (p *PrefixPrinter) Printf(format string, a ...any) *TextPrinter {
277 tp := TextPrinter(p)
278 if p.Debugger && !PrintDebugMessages {
279 return &tp
280 }
281 Fprint(p.GetWriter(), p.Sprintf(format, a...))
282 checkFatal(p)
283 return &tp
284}
285
286// Printfln formats according to a format specifier and writes to standard output.
287// Spaces are always added between operands and a newline is appended.

Callers

nothing calls this directly

Calls 5

GetWriterMethod · 0.95
SprintfMethod · 0.95
TextPrinterInterface · 0.85
FprintFunction · 0.85
checkFatalFunction · 0.85

Tested by

no test coverage detected