# gofmt

Keep Go code in canonical form

List tracked Go files whose format differs from gofmt output. Have CI check that the list is empty and exclude generated files only by explicit policy.

Category: Formatting
Languages: Go

## Standard evidence

Rubric v1 · 3/8 verified · 5 unknown · 0 contrary · reviewed 2026-11-28

- **Definition** (verified) — gofmt specifies the standard formatter for Go source and how it treats supplied files or directories. Reviewed 2026-11-28. [Source](https://pkg.go.dev/cmd/gofmt)
- **Measurement** (verified) — Use gofmt -l to list files whose formatting differs or -d to see the exact diff. An empty list means the checked files already have gofmt formatting. Reviewed 2026-11-28. [Source](https://pkg.go.dev/cmd/gofmt)
- **Conformance** (verified) — The Go distribution publishes paired input and expected golden files, including comments, imports and composite literals. Another formatter can compare its output on the same cases. Reviewed 2026-11-28. [Source](https://github.com/golang/go/tree/master/src/cmd/gofmt/testdata)
- **CI enforcement** (unknown) — No reviewed evidence is recorded for this dimension.
- **Getting started** (unknown) — No reviewed evidence is recorded for this dimension.
- **Real-world adoption** (unknown) — No reviewed evidence is recorded for this dimension.
- **Agent guidance** (unknown) — No reviewed evidence is recorded for this dimension.
- **Agent portability** (unknown) — No reviewed evidence is recorded for this dimension.

## Adoption

Use gofmt in this repository to meet this standard: Keep Go code in canonical form. List tracked Go files whose format differs from gofmt output. Have CI check that the list is empty and exclude generated files only by explicit policy. Inspect the repository configuration, record the baseline and exact reproduction steps, then add the smallest repeatable check that detects a regression.

Seikika package: no verified installation is listed.

## References

- [Tool documentation](https://pkg.go.dev/cmd/gofmt)
- [Agent skill](/skills/gofmt/SKILL.md)
