Go Coverage
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Run a Go module’s (or Go workspace’s) fast, container-free tests with Go’s statement coverage and report the exact, measured coverage for the files the caller cares about, read from the coverprofile. It is a report-only skill: it never adds tests or modifies source or test code.
Purpose
go tool cover -func only reports per-function figures, so iru-go-coverage runs go test -covermode=atomic -coverpkg=<pattern> -coverprofile=build/coverage/cover.out and reads the profile with a small stdlib Python parser. The parser merges the duplicate blocks -coverpkg writes once per test binary, maps import paths back to repository-relative files, excludes generated files (// Code generated … DO NOT EDIT.), and reports the statement % for the total and per file, with uncovered line ranges for files under the bar.
-coverpkg=./… makes code exercised from another package’s tests count, including in-process testscript end-to-end tests that run the Cobra command tree, so a thin cmd/<bin>/main.go and internal/cli are measured fairly. Optionally a second profile from instrumented binaries (go build -cover, GOCOVERDIR, go tool covdata textfmt) is merged in. Branch coverage is reported as "not available in Go". Only container-free tests count toward the gate: the integration build tag is not set unless asked, and then the result is labeled as not the gate value. A target with no statements or outside -coverpkg is reported as "not in profile" rather than a false 0%.
Plugin
Shipped by the iru-go plugin of the ai-catalog marketplace (install with /plugin install iru-go@ai-catalog; see Plugins).
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
Comma-separated Go files, package directories, directory trees ( |
Every file in the profile (whole-module coverage). |
|
No |
The threshold each target is judged against. |
|
|
No |
What is instrumented. In a |
|
|
No |
Build tags, with the semantics of |
Not set. |
|
No |
Narrows the tests that run. Undercounts code other tests also exercise, so the tests that ran are named in the report. |
The whole fast suite. |
|
No |
An extra coverprofile to merge, for example a |
None. |
|
No |
Only meaningful with |
Not set. |
Outputs
-
A plain-text summary in the conversation: the toolchain, how coverage was collected (
-coverpkgpattern,-covermode=atomic, whether a binary profile was merged), the test selection (and thatintegration-tagged tests were not compiled), and whether the tests passed. -
Total statement %, with a verdict against the bar, and "branch coverage: not available in Go".
-
Per target (or per file): statement %, and for every target under the bar the uncovered line ranges.
-
Excluded generated files, thin entry points with no logic, and every
NOT IN PROFILEtarget with its reason. -
Coverage from a failing run is reported with the failures listed, and a build failure is reported instead of a percentage.
-
build/coverage/cover.outis left in place whenbuild/is gitignored, otherwise deleted. No source, test or configuration is ever modified.
Execution flow
Dependencies
Invokes
None — iru-go-coverage is a leaf skill. It follows the toolchain, module/workspace detection and container-backed lock procedure of Go Test by reusing the same rules rather than invoking it.
Invoked by
-
Go Code One Task Group — the 80% statement-coverage gate per changed file, via the
iru-gate-runneragent.
Related agents
-
iru-gate-runner— calling skills normally run it inside this sub-agent. It spawns no agents itself.
Source
SKILL.md on GitHub — the file this page was generated from.