fatih / color

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

Add Fprintf as requested by Francisco #47

Closed ghost closed 7 years ago

ghost commented 7 years ago

Fprintf and FprintfFunc They have many usages, it's a must-feature

Thanks, kataras

chrisdostert commented 7 years ago

@fatih I need this as well, any chance of getting merged to master? This PR also also allows for threadsafe usage; right now the Output is shared across all threads so it can't be made threadsafe.

fatih commented 7 years ago

Hi @kataras

Thanks for the PR, I didn't had much time to look at it. I just had a chance to review and there was a couple of things missing so I went and implemented them myself as the.

Not all Fprint style functions were implemented and it was not correct, as it was still using c.Set() and c.unset() which would use a different writer than c.Fprint. I've fixed with this PR: https://github.com/fatih/color/pull/52 thanks for the feedback though, much appreciated.