Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Static Analysis & Code Quality
  3. gofumpt

gofumpt

BSD-3-ClauseGov0.10.0

A stricter Go code formatter that enforces additional formatting rules beyond gofmt while maintaining compatibility.

Visit WebsiteGitHubGitHub
4.0k stars133 forks0 contributors

What is gofumpt?

gofumpt is a stricter Go code formatter that builds upon the standard gofmt tool by enforcing additional formatting rules. It addresses the need for more consistent and cleaner code formatting in Go projects, automatically applying rules like removing unnecessary empty lines, ensuring consistent composite literal formatting, and properly grouping imports. The tool is designed as a drop-in replacement for gofmt, ensuring that all gofumpt-formatted code remains compatible with gofmt.

Target Audience

Go developers and teams who want to enforce stricter, more consistent code formatting standards in their projects beyond what gofmt provides. It's particularly useful for projects aiming to maintain high code quality and uniformity across large codebases.

Value Proposition

Developers choose gofumpt because it offers a curated set of additional formatting rules that promote cleaner code, while maintaining full backwards compatibility with gofmt. Its seamless integration with editors and CI/CD pipelines makes it easy to adopt without disrupting existing workflows.

Overview

A stricter gofmt

Use Cases

Best For

  • Enforcing stricter code formatting standards in Go projects
  • Teams wanting consistent code style beyond gofmt's defaults
  • Automating code cleanup in CI/CD pipelines
  • Improving readability by removing unnecessary whitespace
  • Ensuring import statements are properly grouped
  • Applying opinionated formatting rules automatically

Not Ideal For

  • Projects satisfied with gofmt's permissive formatting and avoiding extra stylistic constraints
  • Teams using other linters or formatters with conflicting rules that prioritize different code styles
  • Codebases with legacy or custom formatting that developers intentionally preserve, such as specific empty line placements for readability

Pros & Cons

Pros

Enhanced Code Consistency

Enforces stricter rules like removing unnecessary empty lines and ensuring consistent composite literal formatting, leading to cleaner and more readable Go code as demonstrated in the README examples.

Seamless Backwards Compatibility

All gofumpt-formatted code is valid for gofmt, ensuring no conflicts with existing Go tooling; running gofmt after gofumpt produces no changes, making it safe for adoption.

Easy Drop-in Integration

Acts as a direct replacement for gofmt in editors, IDEs, and CI/CD pipelines, with detailed setup guides for VS Code, GoLand, Vim, and others, minimizing workflow disruption.

Extended Formatting Options

Offers additional rules via the -extra flag, such as grouping adjacent parameters and avoiding naked returns, providing more control over code clarity without breaking compatibility.

Cons

Opinionated Rule Enforcement

The stricter formatting rules are subjective and may force stylistic changes that some developers or teams find unnecessary or prefer to handle differently, leading to resistance in adoption.

Configuration Overhead

Setting up gofumpt in certain environments, like GoLand, requires manual configuration of file watchers with specific arguments, which can be cumbersome and error-prone compared to simpler tools.

Limited Customization

While it extends gofmt, gofumpt does not allow disabling individual core rules, so teams must accept all enforced styles or avoid the tool entirely, which can be inflexible for specific needs.

Frequently Asked Questions

Quick Stats

Stars4,043
Forks133
Contributors0
Open Issues15
Last commit1 month ago
CreatedSince 2019

Tags

#developer-tools#style#gofmt#code-formatter#goimports#code-style#code-quality#golang#go#static-analysis#format

Built With

G
Go

Links & Resources

Website

Included in

Static Analysis & Code Quality14.5k
Auto-fetched 4 hours ago

Related Projects

PHP ParserPHP Parser

A PHP parser written in PHP

Stars17,452
Forks1,129
Last commit12 days ago
TypeScript ESLintTypeScript ESLint

:sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript

Stars16,320
Forks2,952
Last commit1 day ago
pyrightpyright

Static Type Checker for Python

Stars15,545
Forks1,797
Last commit2 days ago
ReviewdogReviewdog

🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

Stars9,474
Forks490
Last commit8 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub