gofmt
gofmt: Canonical Go formatting with recursive processing, rewrites, diffs, and editor integrations. Ranked #16 of 34 in Code Formatting Tools by our editors (5.8/10); pricing: Open source; best for go teams wanting canonical formatting.
At a glance
- Editor score5.8 / 10
- PricingOpen source
- Best forGo teams wanting canonical formatting
- Paid fromNone
- Supported languagesGo
- Facts checked21 Sep 2026

Where it wins
- Applies canonical layout rules across Go source code
- Supports recursive directory processing, diffs, rewrites, and simplification
- Integrates with Vim, Emacs, Eclipse, Sublime Text, and Git
Where it doesn't
- Focused on Go rather than multiple programming languages
- Does not support ignore files
- Does not format changed lines only
Our verdict on gofmt
gofmt is a command-line formatter included in the Go distribution. It formats Go programs according to Go's canonical layout rules and accepts standard input, individual files, and directories recursively. Go teams can run it directly or through go fmt, while editor plugins can invoke it during editing or before saving. Its focus is clear: establish consistent formatting for Go code rather than provide a broad, multi-language formatting workspace.
The published distribution model keeps gofmt straightforward for teams already using Go. It is distributed as part of the Go toolchain rather than as a separately priced product. The tool works across Windows, macOS, and Linux, and offers several output and editing modes: formatted output, diffs, changed filenames, or direct file overwrites with the -w option. When overwriting files, it restores backups if errors occur. Rewrite rules and the -s simplification option add scope beyond basic whitespace and layout formatting, while a library API supports programmatic integration.
Its ecosystem fit is strongest where Go is already central to the development workflow. Integrations are available for Vim, Emacs, Eclipse, Sublime Text, and Git, giving teams multiple ways to apply formatting during editing or source-control workflows. The trade-off is a narrow operating model: gofmt supports Go, and its documented category capabilities do not include ignore-file handling or changed-lines-only formatting. Choose it when canonical Go formatting and broad editor access are the priority. Consider another formatter when a workflow needs multi-language coverage, selective changed-line formatting, or ignore-file controls.
gofmt pricing
gofmt fact sheet
| Free plan | Not verified |
|---|---|
| Paid from | None |
| Supported languages | Go |
| Supported platforms | Windows, macOS, Linux |
| Editor integration | Yes |
| Ignore files | No |
| Changed-lines formatting | No |
| Library API | Yes |
| License model | Open_source |
| Deployment | Desktop |
| Platforms | Windows, macOS, Linux |
| Support | Docs, Community |
| Built for | Solo, Small business, Mid-market, Enterprise (editorial estimate) |
| Integrations | 5 integrations: Vim, Emacs, Eclipse, Sublime Text, Git |
| Pricing | Open source |
| Website | go.dev |
| Facts checked | 21 Sep 2026 |
gofmt integrations
gofmt lists 5 integrations on its own site.
- Vim
- Emacs
- Eclipse
- Sublime Text
- Git
Alternatives to gofmt
- dprintA broad, editor-friendly formatter for multilingual repositories and changed-file workflows.9.0
- PrettierA broad, open-source formatter for web-language teams across editors and workflows.8.2
- SpotlessA build-focused formatter for JVM projects that need broad language coverage and automation.7.7
Used gofmt? Be the first to review it
The editor score above is our own research. What this page doesn't have yet is a reader's view — what you used gofmt for, what worked and what didn't. No stars are seeded and no review is paid for; an editor reads every one before it appears.
Write a reviewTwo minutes · verified accounts only · read by an editor before it appears
Featured on iTechGuides
gofmt is listed in our Code Formatting Tools directory. Add the badge to your site — it links back to this page.
<a href="https://www.itechguides.com/products/gofmt/"><img src="https://www.itechguides.com/best/badge/gofmt.svg" alt="Featured on iTechGuides" width="230" height="46"></a>
Reviewed by iTechGuides Editors · Editorial team · Updated Sep 2026
Advertiser disclosure: iTechGuides is reader-supported. We may earn a commission when you click some links. It never changes a score or a verdict. How we rank.
Last updated · How we research and update

