goimports
goimports: A focused Go formatter that cleans imports and supports editor save workflows. Ranked #15 of 34 in Code Formatting Tools by our editors (5.9/10); pricing: Open source; best for go teams needing import cleanup.
At a glance
- Editor score5.9 / 10
- PricingOpen source
- Best forGo teams needing import cleanup
- Paid fromNone
- Supported languagesGo
- Facts checked21 Sep 2026
Where it wins
- Adds missing and removes unreferenced Go imports
- Formats code in gofmt style with optional diff output
- Supports editor save hooks and .goimportsignore exclusions
Where it doesn't
- Supports Go rather than multiple programming languages
- Command-line distribution is narrower than hosted tools
- No AI features
Our verdict on goimports
goimports is an open-source command-line tool for Go developers who want formatting and import management in one workflow. It formats Go source in gofmt style, adds missing imports, and removes unreferenced imports. The tool can process files, directories, or standard input, and it can write formatted output back to source files. Its focus is narrow: teams working primarily in Go will get the clearest fit, while developers seeking a multi-language formatter should consider a broader tool.
Its strongest advantage is the depth of its formatting and import workflow. goimports can rewrite files in place, display diffs instead of changing files, list files whose formatting differs, or run in format-only mode. A .goimportsignore file can exclude directories from import scanning, which gives teams control over where import cleanup applies. The underlying imports functionality is also available through a Go package API, extending its use beyond the command-line interface. These options suit repositories that need formatting checks, review-friendly diffs, or automated save-time cleanup.
Editor integration adds practical ecosystem fit without changing the tool's Go-centered scope. Published integrations include Emacs, Vim, and GoSublime, while save hooks support formatting as part of an editor workflow. goimports is distributed as a Go command through the golang.org/x/tools module and is open source, rather than presented as a hosted service with commercial tiers. Choose it for Go projects that want automatic import cleanup alongside gofmt-style formatting. Choose an alternative if your team needs broad language coverage, a hosted platform, or AI-assisted formatting.
goimports pricing
goimports fact sheet
| Free plan | Not verified |
|---|---|
| Paid from | None |
| Supported languages | Go |
| Supported platforms | web, windows, macos, linux |
| Editor integration | Yes |
| Ignore files | Yes |
| Changed-lines formatting | Not verified |
| Library API | Yes |
| License model | Open_source |
| Deployment | Cloud, Desktop |
| Platforms | Web, Windows, macOS, Linux |
| Support | Docs |
| Built for | Solo, Small business, Mid-market, Enterprise (editorial estimate) |
| Integrations | 3 integrations: Emacs, Vim, GoSublime |
| Pricing | Open source |
| Website | pkg.go.dev |
| Facts checked | 21 Sep 2026 |
goimports integrations
goimports lists 3 integrations on its own site.
- Emacs
- Vim
- GoSublime
Alternatives to goimports
- 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
See all goimports alternatives →
Used goimports? 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 goimports 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
goimports 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/goimports/"><img src="https://www.itechguides.com/best/badge/goimports.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

