对“ go test” CLI测试报告程序的建议

I plan to use the golang's testing package and go test for writing unit tests. I find go test only provides coverage report in the CLI, but I cannot find any go test option allowing me to get a summary report for the test suite.

For example, after running tests, I would like to see a minimal test report including the following information:

  • how many tests in the test suite
  • how many of them pass
  • how many of them fail

I did some web search, but cannot find any good golang native option/third party tool/library to support this. And I only found a library https://github.com/jstemmer/go-junit-report that allows me to convert the results into JUnit XML which requires me to do some further processing to get the summary, which is not convenient enough.

I would like to know when working with go test and the testing package, what is the tool/library people typically use for such test report generation purpose, in particular when running via CLI? Thanks.

The go test command has a variety of flags which includes -v verbose flag. This option prints test specifics as well as test suite stats.