Dan Anglin
bff1eba972
Add support for disabling ANSI colour output via the --no-color flag or the NO_COLOR environment variable. The suggested implementation was inspired by the standards defined at no-color.org
11 lines
186 B
Go
11 lines
186 B
Go
package utilities
|
|
|
|
import "os"
|
|
|
|
type Displayer interface {
|
|
Display(noColor bool) string
|
|
}
|
|
|
|
func Display(d Displayer, noColor bool) {
|
|
os.Stdout.WriteString(d.Display(noColor) + "\n")
|
|
}
|