Just a hint: how to make `color` pkg works in `go test` command.
Currently, this package does not works when run command `go test`.
Such as `t.Errorf("error message")` will not print colored text content.
A bypass solution:
First, `color.NoColor = false` is a must to config.
Them, `color.Red("error message")` + `t.FailNow()` == `t.Errorf()`
And it works for me now.
1 条评论