Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 3.01 KB

basictext.md

File metadata and controls

53 lines (38 loc) · 3.01 KB

BasicTextPrinter

BasicTextPrinter Example

(Show source of demo)

Usage

Basic usage

pterm.DefaultBasicText.Println("Hello, World!")

Options

To make a copy with modified options you can use: pterm.DefaultBasicText.WithOptionName(option)

To change multiple options at once, you can chain the functions: pterm.DefaultBasicText.WithOptionName(option).WithOptionName2(option2)...

Tip

Click the options and types to show the documentation on pkg.go.dev

Option Type
Style *Style
Writer io.Writer

Output functions

This printer implements the interface TextPrinter

Function Description
Sprint(a ...interface{}) Returns a string
Sprintln(a ...interface{}) Returns a string with a new line at the end
Sprintf(format string, a ...interface{}) Returns a string, formatted according to a format specifier
Sprintfln(format string, a ...interface{}) Returns a string, formatted according to a format specifier with a new line at the end
Print(a ...interface{}) Prints to the terminal
Println(a ...interface{}) Prints to the terminal with a new line at the end
Printf(format string, a ...interface{}) Prints to the terminal, formatted according to a format specifier
Printfln(format string, a ...interface{}) Prints to the terminal, formatted according to a format specifier with a new line at the end

Related