diff --git a/README.md b/README.md index a31dcda..e7164cd 100644 --- a/README.md +++ b/README.md @@ -186,4 +186,14 @@ func testMockDocker() { } -``` \ No newline at end of file +``` + +## 生成覆盖率及测试报告 + +```bash + +go test -timeout 0 -covermode=count -coverprofile=coverage.out -run="^Test" -coverpkg=package1,package2 + +go tool cover -html=coverage.out -o coverage.html + +```