What version of Go are you using (go version)?
$ go version
go version go1.16.2 windows/amd64
Proposal
Can we have color print when unit test case fail?
What did you expect to see?
Maybe we can have color print when unit test pass or fail, we can make a switch in pkg testing like t.RedErrorf(...)or cmd go test like go test ./... --color
What did you see instead?
When we have many test cases, and normally we will add -v to debug, it's hard to find the failed case.
Because we have many test flags,likego test $(go list ./... | grep -v "/neverTest") -coverprofile=cover.out -covermode=conut -gcflags=all=-l -v, the go test cmd will be placed in a unit_test.sh typically.
We won't change the script, keeping -v, which will bring many debug messages, resulting in the fact that it's hard for us to find which case failed.
By the way, do we have some better ways to only test some dirs, or exclude some dirs?
What version of Go are you using (
go version)?Proposal
Can we have color print when unit test case fail?
What did you expect to see?
Maybe we can have color print when unit test pass or fail, we can make a switch in
pkg testingliket.RedErrorf(...)orcmd go testlikego test ./... --colorWhat did you see instead?
When we have many test cases, and normally we will add -v to debug, it's hard to find the failed case.
Because we have many test flags,like
go test $(go list ./... | grep -v "/neverTest") -coverprofile=cover.out -covermode=conut -gcflags=all=-l -v, thego testcmd will be placed in aunit_test.shtypically.We won't change the script, keeping
-v, which will bring many debug messages, resulting in the fact that it's hard for us to find which case failed.