pterm.DefaultBox.Println("test")
To make a copy with modified options you can use:
pterm.DefaultBox.WithOptionName(option)
To change multiple options at once, you can chain the functions:
pterm.DefaultBox.WithOptionName(option).WithOptionName2(option2)...
Tip
Click the options and types to show the documentation on pkg.go.dev
Option | Type |
---|---|
BottomLeftCornerString | string |
BottomPadding | int |
BottomRightCornerString | string |
BoxStyle | *Style |
HorizontalString | string |
LeftPadding | int |
RightPadding | int |
Text | string |
TextStyle | *Style |
Title | string |
TitleBottomCenter | boolean |
TitleBottomLeft | boolean |
TitleBottomRight | boolean |
TitleTopCenter | boolean |
TitleTopLeft | boolean |
TitleTopRight | boolean |
TopLeftCornerString | string |
TopPadding | int |
TopRightCornerString | string |
VerticalString | string |
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 |