We got many popular packages in Go to render colorized text in terminal, like fatih/color, gookit/color, lucasb-eyer/go-colorful.
However I'm facing a problem that --- apart from seeing with my own eyes, how to detect if current terminal supports 16-Color or 256-Color programmatically in Go (even on Windows)?
As mentioned in "Determine whether the current Linux console supports 256 colours?" (and that is on Linux, the same portability issue would exist on Windows)
As an example of non-portable option, you could use curses (on Linux), as discussed here and implemented in curses.go: