printColored prints colored output if colors are enabled
(useColor bool, color, format string, args ...any)
| 479 | |
| 480 | // printColored prints colored output if colors are enabled |
| 481 | func printColored(useColor bool, color, format string, args ...any) { |
| 482 | if useColor { |
| 483 | fmt.Printf(color+format+colorReset, args...) |
| 484 | } else { |
| 485 | fmt.Printf(format, args...) |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | // isTerminal checks if the writer is a terminal |
| 490 | func isTerminal(w io.Writer) bool { |
no test coverage detected