pterm.DefaultBasicText.Println("Hello, World!")
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 |
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 |