// the find
fatih/color
Color package for Go (golang)
color wraps ANSI escape codes in a small Go API for printing colored text, setting attributes on a stream, and building reusable color objects. It is aimed at CLI authors who want colored output without pulling in a TUI framework, and at 8,000 stars it is one of the most-used options for this in Go.
The surface is small and stays out of the way: color.Red for one-offs, New(...) objects you can keep and reuse, Fprint variants that take any io.Writer, and SprintFunc for mixing colored fragments into strings you are already building. Per-object EnableColor and DisableColor let a library turn color off for one value without touching process-wide state. It honors NO_COLOR and runs the TTY check for you via go-isatty, and Windows support goes through mattn/colorable instead of a hand-rolled console layer.
The package-level state is the main trap. NoColor, Output, and the Set/Unset pair are globals, so a library that calls Set or flips NoColor changes output for every caller in the process, and goroutines using Set and Unset concurrently will fight over the same state. Color depth is not detected: RGB and 256-color sequences are emitted whenever color is on, so on a 16-color terminal you get whatever that terminal makes of them. Windows support also depends on the caller remembering to write to color.Output; the README has to say so, and forgetting it gives you raw escape codes. The GitHub Actions section is a tell as well, since CI log viewers need a manual NoColor = false because the TTY heuristic guesses wrong for them.