Help us shape the future of Go! Take the 2026 Go Developer Survey

covfloor

command
v1.4.15 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Command covfloor checks per-package statement coverage against floors kept as data (contract cap:cli.coverage-floors, EPIC P7-GUARD decision G7).

go run -mod=vendor ./tools/covfloor -profile coverage.out -floors .github/coverage-floors.txt [-strict] [-json]
go run -mod=vendor ./tools/covfloor -profile coverage.out -floors .github/coverage-floors.txt -write

The profile is the single `go test -coverprofile` output of ./...; a package is the module-relative directory of its files, and its coverage is covered statements over all statements of those files. The floors file holds one `<package> <integer floor> # comment` line per package.

It fails closed. Exit 1 when a package is below its floor, when a floors line names a package with no statements in the profile (stale), when the profile or the floors file is missing, empty or malformed, and, with -strict, when a profiled package has no floors line. Without -strict such UNFLOORED packages are only printed. -write appends the missing packages at max(0, floor(measured)-2) and never changes an existing line. Exit 2 is a usage error.

Jump to

Keyboard shortcuts

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