# go-cover > Generate Go test coverage report with package breakdown. - Author: Otávio Fernandes - Repository: otaviof/gosmith - Version: 20260129193112 - Stars: 1 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/otaviof/gosmith - Web: https://mule.run/skillshub/@@otaviof/gosmith~go-cover:20260129193112 --- --- name: go-cover description: Generate Go test coverage report with package breakdown. argument-hint: [package-pattern] allowed-tools: Bash model: haiku --- ## Instructions 1. **Validate**: Check `go.mod` exists in cwd or parent dirs 2. **Execute**: - Pattern: `` or default `./...` - `--html`: Generate `coverage.html` and report path - Run: `go test -coverprofile=coverage.out -covermode=atomic ` 3. **Parse**: Extract per-package coverage from `coverage.out` - Skip mode/total lines - Group by package path - Calculate percentage: (covered statements / total statements) × 100 4. **Format**: ```markdown ## COVERAGE REPORT | Package | Coverage | Target | Status | |----------------|----------|--------|--------| | pkg/domain | 87.2% | 80% | PASS | | pkg/service | 72.1% | 80% | FAIL | **Overall:** 83.4% | **Target:** 80% | **Status:** PASS ``` 5. **Report**: - Standard: Markdown table with overall status - HTML mode: "Coverage report: `coverage.html`" 6. **Edge cases**: - No tests: "No test files found in ``" - Build failure: Report compilation errors (first 5 lines) - Target: Env `GO_COVER_TARGET` or default 80%