gofmt
Hacker ApprovedThe most recommended of 7 code formatters
Go's built-in formatter that ends style debates by enforcing one standard format with almost no settings. Critics say it does not break long lines and is not strict enough.
Go's built-in formatter that ends style debates by enforcing one standard format with almost no settings. Critics say it does not break long lines and is not strict enough.
31 people gave an opinion
- recommend it
- 26
- criticize it
- 5
- approval share
- 84%
Recommended in 10 of 13 months
- November 2025: recommended
- December 2025: recommended
- January 2026: recommended
- February 2026: recommended
- March 2026: recommended
- April 2026: recommended
- May 2026: recommended
- June 2026: not recommended
- July 2026: recommended
- August 2026: recommended
- September 2026: not recommended
- October 2026: recommended
- November 2026: not recommended (month in progress)
Why it carries the badge
- 26 people recommend itNeeds 10 or more, met.
- 5.2 recommenders for every criticNeeds 2 to 1 or better, met.
- Recommended in 10 of 13 monthsNeeds 4 or more, met.
The same three rules apply to every product, and the badge can’t be bought. How the badge works
What people say about it
The reasons people give, with the number of comments that give each one. Open a reason to read what they said.
Why people recommend it
Each mark is one comment
Widely loved by Go developers
“gofmt’s style is nobody’s favorite, yet gofmt is everybody’s favorite.”
Comment from 26 Jul 2026 in “Ruff v0.16.0 – Significant new updates – 413 default rules up from 59” “Gofmt's style is no one's favorite, yet gofmt is everyone's favorite.”
Comment from 20 Aug 2026 in “Go 1.27 Is Released” “yet gofmt is everyone's favorite.”
Comment from 22 Oct 2026 in “Rust Style Guide” - Comment from 1 Nov 2025 on Hacker News
- Comment from 18 Feb 2026 in “Using go fix to modernize Go code”
Ends formatting debates and style discussions
“The best part about gofmt is there is no discussion about how to format Go code.”
Comment from 5 May 2026 in “Formatting a 25M-line codebase overnight” “go kinda eliminates a lot of the reasons for style guides to exist w/ `go fmt`”
Comment from 8 Jan 2026 in “The Jeff Dean Facts” “enforcing the same style ends all of the drama”
Comment from 2 Nov 2025 on Hacker News - Comment from 12 Apr 2026 in “JVM Options Explorer”
Opinionated with few knobs
“modern opinionated tooling like gofmt, that does not come with hundreds to thousands of knobs”
Comment from 12 Apr 2026 in “JVM Options Explorer” “opinionated tooling like gofmt, that does not come with hundreds to thousands of knobs”
Comment from 12 Apr 2026 in “JVM Options Explorer” “I think gofmt works much better, and that's in large part because it tries to do less.”
Comment from 2 Nov 2025 on Hacker News - Comment from 12 Apr 2026 in “JVM Options Explorer”
Built into Go, satisfying to run
“it's so satisfying to me when I just run "gofmt" and know the thing is formatted well.”
Comment from 1 Nov 2025 on Hacker News “it's so satisfying to me when I just run "gofmt" and know the thing is formatted well”
Comment from 2 Nov 2025 on Hacker News “gofmt was somewhat revolutionary for being a built-in”
Comment from 26 Jul 2026 in “Ruff v0.16.0 – Significant new updates – 413 default rules up from 59” - Comment from 22 Oct 2026 in “Rust Style Guide”
What people warn about
Each mark is one comment
Not strict or opinionated enough
“Gofmt is a great idea but it isn't strict enough for my taste.”
Comment from 26 Jul 2026 in “Ruff v0.16.0 – Significant new updates – 413 default rules up from 59” “Gofmt is great but it's still not very strict”
Comment from 26 Jul 2026 in “Ruff v0.16.0 – Significant new updates – 413 default rules up from 59” “as gofmt is not opinionated enough”
Comment from 26 Jul 2026 in “Ruff v0.16.0 – Significant new updates – 413 default rules up from 59” Does not break long lines
“The most important task of a code formatter is to break long lines; it doesn't do it.”
Comment from 12 Aug 2026 in “Why Go Is an Ideal Language for AI-Assisted Software Engineering” “It doesn't even have an option to do it!”
Comment from 12 Aug 2026 in “Why Go Is an Ideal Language for AI-Assisted Software Engineering”
Other code formatters people recommend
The four most recommended other code formatters, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.
| Product | Recommend | Criticize | Approval | Months | Owned | Badge |
|---|---|---|---|---|---|---|
| gofmtThis page | 26 | 5 | 84% | 10 | — | Approved |
| Black | 18 | 6 | 75% | 6 | — | Approved |
| FracturedJson | 18 | 2 | 90% | 2 | — | — |
| Prettier | 16 | 10 | 62% | 8 | — | — |
| Oxfmt | 14 | 9 | 61% | 6 | — | — |
What people said
31 of the 34 comments that mention it, newest first. Each links to the original comment.
“first time I saw a language mandate it's formatting”
“yet gofmt is everyone's favorite.”
“Things like this make me appreciate Gofmt so much”
“That's been a major success”
“Gofmt's style is no one's favorite, yet gofmt is everyone's favorite.”
“It doesn't even have an option to do it!”
“The most important task of a code formatter is to break long lines; it doesn't do it.”
“I'd read about this many times before I started with Go so I was particularly disappointed to learn that it was a lie.”
“'go fmt' is the only one that matters”
“I love gofmt, rustfmt, ruff.”
“as gofmt is not opinionated enough”
“gofmt was somewhat revolutionary for being a built-in”
“gofmt’s style is nobody’s favorite, yet gofmt is everybody’s favorite.”
“Gofmt is great but it's still not very strict”
“Gofmt is a great idea but it isn't strict enough for my taste.”
“The best part about gofmt is there is no discussion about how to format Go code.”
“opinionated tooling like gofmt, that does not come with hundreds to thousands of knobs”
“you can't argue with the results, nobody writing go on any project ever worries about code formatting”
“I have really come to appreciate modern opinionated tooling like gofmt”
“modern opinionated tooling like gofmt, that does not come with hundreds to thousands of knobs”
“if your golangci-lint uses a different gofmt version than your IDE”
“the right execution is in the style of 'go fmt' with Go”
“adding a space to "//+build", which already breaks setups that add a build comment”
“one of the top loved features among gophers”
“go kinda eliminates a lot of the reasons for style guides to exist w/ `go fmt`”
“having gofmt bitch about stuff before you commit it rather than have the compiler bitch about it helps you”
“enforcing the same style ends all of the drama”
“I think gofmt works much better, and that's in large part because it tries to do less.”
“it's so satisfying to me when I just run "gofmt" and know the thing is formatted well”
“yet gofmt is everyone's favorite”
“it's so satisfying to me when I just run "gofmt" and know the thing is formatted well.”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.