Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just a hint: how to make color pkg works in go test command. #234

Open
92hackers opened this issue Jun 18, 2024 · 1 comment
Open

Just a hint: how to make color pkg works in go test command. #234

92hackers opened this issue Jun 18, 2024 · 1 comment

Comments

@92hackers
Copy link

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.

@apuatcfbd
Copy link

Thanks, your question has the answer I need 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants