Since printing colors on Windows requires defining the colorised writer (fmt.Fprint(color.Output, ...)), this PR exposes the equivalent colorised Stderr writer. So the following would be supported:
var green = color.New(color.FgGreen).SprintFunc()
var red = color.New(color.FgRed).SprintFunc()
fmt.Fprintln(color.Output, green("This is normal green text")) // Prints to os.Stdout
fmt.Fprintln(color.Output, red("This is normal red text")) // Prints to os.Stdout
fmt.Fprintln(color.Error, red("This is error red text")) // Prints to os.Stderr
Since printing colors on Windows requires defining the colorised writer (
fmt.Fprint(color.Output, ...)
), this PR exposes the equivalent colorised Stderr writer. So the following would be supported: