genapi

command
v1.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Command genapi enumerates the exported API surface of pkg/compliancekit and writes (or diffs) the canonical snapshot at pkg/compliancekit/api.txt.

Run:

go run ./cmd/genapi              # regenerate pkg/compliancekit/api.txt
go run ./cmd/genapi -check       # exit 1 if the snapshot is stale
go run ./cmd/genapi -out=foo.txt # write somewhere else

The -check mode is the v1.0 CI gate. It is what turns "we promise API stability" into a machine-enforced invariant: a maintainer can only widen, narrow, or rename the public contract by committing the regenerated api.txt in the same PR, which makes every contract change visible at review time.

Why a separate tool rather than a //go:generate inside pkg/compliancekit? The package is intentionally tiny and self- contained at v1.0; pulling a generator into it would bloat the import graph for embedders. Keeping the tool under cmd/ also mirrors the gencheckdocs pattern already established for the checks catalog.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL