Closed wafuwafu13 closed 1 year ago
I want to add support for Errorf.
Before
func exampleFunc() error { ex, err := foo() red := color.New(color.FgRed) if err != nil { return fmt.Errorf(red.Sprintf("this is error: %s", err)) } ... }
After
func exampleFunc() error { ex, err := foo() red := color.New(color.FgRed) if err != nil { return red.Errorf("this is error: %s", err) } ... }
Hi @wafuwafu13 Thanks for your contribution.
Errors are not meant to be colorized. They are values, and adding a color means you're creating a new error from scratch.
I want to add support for Errorf.
Before
After