talira

go-colorable

Colorable writer for Windows

open sourceMITfree

go-colorable is a Go package that gives Windows consoles ANSI colour: its writers translate ANSI escape sequences so coloured output from loggers such as Logrus shows in colour instead of raw codes. Code that uses it still compiles and runs on other operating systems.

Problems it solves

  • my Go program's coloured log output shows escape codes on Windows
  • show ANSI colours in the Windows console from a Go CLI
  • make logrus colours work for users on Windows

Features

  • ANSI colour escape sequences on Windows consoles
  • colourable stdout and stderr writers
  • builds on non-Windows systems too

Alternatives

The same job

These do what go-colorable does.

  1. Colorama Cross-platform coloured terminal text in Python
  2. color (Go) Coloured terminal output for Go with ANSI escape codes

Compare go-colorable with the top 3