Documentation ¶
Overview ¶
Package lscolors provides methods for colorizing file names based on colors from dircolors
Index ¶
Examples ¶
Constants ¶
View Source
const ( RESET = "rs" // Reset DIR = "di" // Directory LINK = "ln" // Symbolic link FIFO = "pi" // Pipe SOCK = "so" // Socket BLK = "bd" // Block device driver CHR = "cd" // Character device driver STICKY = "st" // Dir with the sticky bit set (+t) and not other-writable EXEC = "ex" // Executable files )
Variables ¶
View Source
var DisableColors = os.Getenv("NO_COLOR") != ""
DisableColors disables all colors in output
Functions ¶
func Colorize ¶
Colorize return file name with ANSI control sequences
Example ¶
file := "myfile.txt" fmt.Println(Colorize(file))
Output:
func ColorizePath ¶
Colorize return path with ANSI control sequences
Example ¶
path := "/home/john/myfile.txt" fmt.Println(ColorizePath(path))
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.