Documentation ¶
Overview ¶
Package formatutil manipulates string colors and other formatting operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Bold formats the arguments in bold for terminals Bold = Color("\033[1m%s\033[0m") // Faint format the arguments in faint for terminals Faint = Color("\033[2m%s\033[0m") // Italic formats the arguments in italic for terminals Italic = Color("\033[3m%s\033[0m") // Red formats the arguments in red for terminals Red = Color("\033[1;31m%s\033[0m") // Green formats the arguments in green for terminals Green = Color("\033[1;32m%s\033[0m") // Yellow formats the arguments in yellow for terminals Yellow = Color("\033[1;33m%s\033[0m") // Purple formats the arguments in purple for terminals Purple = Color("\033[1;34m%s\033[0m") // Magenta formats the arguments in magenta for terminals Magenta = Color("\033[1;35m%s\033[0m") // Cyan formats the arguments in cyan for terminals Cyan = Color("\033[1;36m%s\033[0m") // White formats the arguments in white for terminals White = Color("\033[1;37m%s\033[0m") )
Functions ¶
func Color ¶
Color is a formatter helper that wraps the arguments suing the color string provided. Checks whether the standard output is a terminal.
func SanitizeRepr ¶
SanitizeRepr is a simple sanitizer that removes all escape sequences from the string representation of an object
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.