fatih / color

Color package for Go (golang)
https://pkg.go.dev/github.com/fatih/color
MIT License
7.26k stars 615 forks source link

PrintlnFunc is not compatible to fmt.Println #81

Closed jojomi closed 6 years ago

jojomi commented 6 years ago

What do you think about PrintlnFunc returning a func compatible to fmt.Println regarding to the return params?

Something like this:


// PrintlnFunc returns a new function that prints the passed arguments as
// colorized with color.Println().
func (c *Color) PrintlnFunc() func(a ...interface{}) (int, error) {
    return func(a ...interface{}) (int, error) {
        return c.Println(a...)
    }
}```
fatih commented 6 years ago

This came up before if you search for the Closed PR's or issues. The problem is that this breaks the API and this package is right now imported by hundreds of other packages. It's like this now forever (until I release a breaking version, which I don't want to right now). Thanks