Documentation
¶
Overview ¶
Command apitxt writes and checks the API golden files of the module: one sorted text file per public package under api/go, one fact per line, plus the tier checks of docs/specs/api-stability.md §4.3.
go run ./internal/cmd/apitxt -w rewrite api/go/*.txt
go run ./internal/cmd/apitxt -check fail when api/go is out of date or a check fails
go run ./internal/cmd/apitxt -classify < apidiff.out
tag apidiff lines as stable/experimental (scripts/apidiff.sh)
The API is loaded from compiler export data (go list -export) for each of linux, darwin and windows with CGO_ENABLED=0 and merged; lines that only exist on some platforms carry a " [darwin]"-style suffix. Only the standard library is used, like site/tools/apigen.
Files are named after the package path relative to the module with "/" replaced by "_" (ui/theme -> api/go/ui_theme.txt); the root package uses its package name (api/go/tango.txt). Tiers come from api/tiers.txt and the stable-symbol allowlists of "split" packages from api/stable/<same name>.txt. See docs/release.md ("API 稳定性").