Go Cookbook
上QQ阅读APP看书,第一时间看更新

An ANSI coloring application

Coloring an ANSI terminal application is handled by a variety of code before and after a section of text you want colored. This chapter will explore a basic coloring mechanism to color text red or plain. For a complete application, take a look at https://github.com/agtorre/gocolorize, which supports many more colors and text types and also implements the fmt.Formatter interface for ease of printing.