golang写测试用例报no tests were run

在写go的测试test时,可能·会出现报 no tests were run 或者no test files问题,如果其他解决方法不行的话,可以试一下将该测试的文件名修改成蛇形如:trim_space_test.go 后面加一个 _test 就可以进行测试了。

修改前:
golang写测试用例报no tests were run_第1张图片
修改后:
golang写测试用例报no tests were run_第2张图片

你可能感兴趣的:(go语言基础)