fatih / color

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

Documentation lies about Println #218

Closed ShadiestGoat closed 3 months ago

ShadiestGoat commented 6 months ago

The documentation for Color.Println says:

Spaces are always added between operands and a newline is appended.

However, this is not the case. The method uses c.wrap around fmt.Sprint, which has the following space separation:

Spaces are added between operands when neither is a string. Source

Example problem:

color.New(color.FgCyan).Println("Foo", "Bar")

Expected output is "Foo Bar", real output is "FooBar".