Documentation
¶
Overview ¶
Package text contains functions for formatting console text.
Index ¶
- Constants
- func Boldf(format string, args ...interface{}) string
- func CenterText(text string, width int) string
- func PadCurrencyLeft(d decimal.Decimal, width int) string
- func PadIntegerLeft(i int, width int) string
- func PadTextLeft(text string, width int) string
- func PadTextRight(text string, width int) string
- func WrapText(text string, width int) string
Constants ¶
const StandardTerminalWidthInChars = 80
StandardTerminalWidthInChars describes the width of a standard terminal window.
Variables ¶
This section is empty.
Functions ¶
func Boldf ¶
Boldf returns the formatted string, with bash-style "bright white" text.
If the program has determined stdout is not a color terminal, the text will be formatted and returned, un-styled.
func CenterText ¶
CenterText returns the given text centered according to the specified width in characters.
func PadCurrencyLeft ¶
PadCurrencyLeft formats the decimal value and pads the left side to the specified width.
func PadIntegerLeft ¶
PadIntegerLeft formats the integer and pads the left side to the specified width.
func PadTextLeft ¶
PadTextLeft pads the left side of the given text to ensure it is the specified width.
func PadTextRight ¶
PadTextRight pads the right side of the given text to ensure it is the specified width.
Types ¶
This section is empty.