gofmt¶
Upstream: ships with the Go toolchain
Check: format
Stacks: go
What it does¶
gofmt is the canonical Go formatter. It is the arbiter of Go code style - there is no configuration. Lintel uses it as the format check on Go files.
How Lintel invokes it¶
-l: list files whose formatting differs from canonical. Lintel reports each listed file as a singlewarnfinding (no line-level detail, becausegofmtoperates on the whole file).
Severity mapping¶
gofmt status |
Lintel severity |
|---|---|
| file differs | warn |
Files that format cleanly produce no finding.
Configuration¶
gofmt has no configuration. Lintel does not pin its hash because gofmt is part of the Go distribution you already verified when you installed Go.
Auto-fixing¶
In v1.0, lintel fmt reports only; you fix with the upstream tool or your editor.
Relationship to goimports¶
gofmt does not manage imports. Many Go teams prefer goimports (which is a superset that also reformats import blocks). Lintel does not ship a goimports adapter in v1.0 because the two are near-identical in output - if you need goimports, set scanners.gofmt.path: goimports and the adapter will pass through unchanged.