如何测量GO中的隔离文件夹的代码覆盖范围
[0.0%]问题,您可以使用-coverpkg选项来指定应考虑哪些软件包进行覆盖分析。 For example, the following command will include all packages under the current directory:
go test ./test/... -coverprofile=cover.out -coverpkg ./...Once the test execution is complete, you can generate a coverage report using:stuff/stuff.go -> package: stuff test/stuff/stuff_test.go -> package: testgo tool cover -html=cover.outThis will提供有关您项目的代码覆盖范围的详细报告,包括在单独的文件夹中覆盖包装的覆盖范围。
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3