Documentation
¶
Overview ¶
Command doccover enforces ExampleXxx coverage on ax-go's primary API surface.
Go's ExampleXxx functions compile and (when they declare an Output comment) are executed by `go test`, which makes them self-verifying documentation that cannot silently drift the way a prose comment can. Only output-declaring examples ("// Output:" or "// Unordered output:") count as coverage: a compile-only example proves nothing about behavior. doccover gates the curated primary API only: constructors, the core exported types, and the principal entry points. The broad expectation that every exported symbol carries a doc comment is enforced separately by golangci-lint (godoclint's require-doc).
Coverage is ratcheted through baseline.txt so the gate can land before every example exists. doccover fails on (1) a regression — a required symbol with no verified example that is not listed in the baseline; (2) a required symbol that is no longer exported (renamed or removed); and (3) a stale baseline entry — once a symbol gains a verified example its baseline line must be pruned, making the ratchet one-way.
Run from the module root:
go run ./internal/cmd/doccover