GS/BS
← Standards directory
Formatting

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.

Go

Community rubric · v1

The evidence

Evidence coverage3 / 8
3 supported · 5 unresolved

One point for each verified check. Unknown means we still need evidence. Contrary evidence records an observed result that goes against the criterion.

Latest evidence review ·

  • Definition

    Verified

    gofmt specifies the standard formatter for Go source and how it treats supplied files or directories.

    Cited source ↗
  • 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.

    Cited source ↗
  • 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.

    Cited source ↗
  • CI enforcement

    Unknown

    No reviewed evidence is recorded for this dimension.

    Can a change trigger a useful check? Contribute evidence ↗

  • Getting started

    Unknown

    No reviewed evidence is recorded for this dimension.

    Can a newcomer complete a first run? Contribute evidence ↗

  • Real-world adoption

    Unknown

    No reviewed evidence is recorded for this dimension.

    Has another team put it to work? Contribute evidence ↗

  • Agent guidance

    Unknown

    No reviewed evidence is recorded for this dimension.

    Can an agent act on a specific finding? Contribute evidence ↗

  • Agent portability

    Unknown

    No reviewed evidence is recorded for this dimension.

    Does the practice work in two agent harnesses? Contribute evidence ↗

Use this standard

Agent prompt

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.
Read the agent skill ↗

Primary source

gofmt documentation ↗