gofumpt
brew install gofumpt
v0.10.0_1
BSD-3-Clause
Stricter gofmt
715
30-day installs · #1487
1.5k
90-day · #1800
4.2k
365-day · #2079
4.0k
★ GitHub stars · updated 2mo ago
Runtime dependencies
GitHub topics
format
go
gofmt
goimports
idiomatic
style
Links
- https://github.com/mvdan/gofumpt
- GitHub: mvdan/gofumpt
- Brew formula source: Formula/g/gofumpt.rb
Raw metadata
{
"aliases": [],
"alternatives": [],
"build_dependencies": [],
"categories": [],
"caveats": null,
"conflicts_with": [],
"dependencies": [
"go"
],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Stricter gofmt",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:38:17+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "gofumpt",
"github_default_branch": "master",
"github_last_commit_at": "2026-05-31T21:33:01Z",
"github_readme_excerpt": "# gofumpt\n\n[](https://pkg.go.dev/mvdan.cc/gofumpt/format)\n\n\tgo install mvdan.cc/gofumpt@latest\n\nEnforce a stricter format than `gofmt`, while being backwards compatible.\nThat is, `gofumpt` is happy with a subset of the formats that `gofmt` is happy with.\n\nThe tool is a fork of `gofmt` as of Go 1.26.0, and requires Go 1.25 or later.\nIt can be used as a drop-in replacement to format your Go code,\nand running `gofmt` after `gofumpt` should produce no changes.\nFor example:\n\n\tgofumpt -l -w .\n\nSome of the Go source files in this repository belong to the Go project.\nThe project includes copies of `go/printer` and `go/doc/comment` as of Go 1.26.0\nto ensure consistent formatting independent of what Go version is being used.\nThe [added formatting rules](#Added-rules) are implemented in the `format` package.\n\n`vendor` and `testdata` directories are skipped unless given as explicit arguments.\nSimilarly, the added rules do not apply to generated Go files unless they are\ngiven as explicit arguments.\n\n[`ignore` directives](https://go.dev/ref/mod#go-mod-file-ignore) in `go.mod` files are obeyed as well,\nunless directories or files within them are given as explicit arguments.\n\nFinally, note that the `-r` rewrite flag is removed in favor of `gofmt -r`,\nand the `-s` flag is hidden as it is always enabled.\n\n### Added rules\n\n**No newline after a simple assignment\u0027s operator**\n\n\u003cdetails\u003e\u003csummary\u003e\u003ci\u003eExample\u003c/i\u003e\u003c/summary\u003e\n\n```go\nfunc foo() {\n foo :=\n \"bar\"\n}\n```\n\n```go\nfunc foo() {\n\tfoo := \"bar\"\n}\n```\n\n\u003c/details\u003e\n\n**No empty lines around function bodies**\n\n\u003cdetails\u003e\u003csummary\u003e\u003ci\u003eExample\u003c/i\u003e\u003c/summary\u003e\n\n```go\nfunc foo() {\n\n\tprintln(\"bar\")\n\n}\n```\n\n```go\nfunc foo() {\n\tprintln(\"bar\")\n}\n```\n\n\u003c/details\u003e\n\n**Functions should separate `) {` where the indentation helps readability**\n\n\u003cdetails\u003e\u003csummary\u003e\u003ci\u003eExample\u003c/i\u003e\u003c/summary\u003e\n\n```go\nfunc foo(s string,\n\ti int) {\n\tprintln(\"bar\")\n}\n\n// With an empty line it\u0027s slightly better, b",
"github_repo": "mvdan/gofumpt",
"github_stars": 4012,
"github_topics": [
"format",
"go",
"gofmt",
"goimports",
"idiomatic",
"style"
],
"homepage": "https://github.com/mvdan/gofumpt",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 715,
"installs_365d": 4230,
"installs_90d": 1532,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "BSD-3-Clause",
"llm_generated_at": null,
"llm_model": null,
"name": "gofumpt",
"oldnames": [],
"one_liner": null,
"optional_dependencies": [],
"rank_30d": 1487,
"rank_365d": 2079,
"rank_90d": 1800,
"raw_hash": "5869dcd18bcf7f7b",
"recommended_dependencies": [],
"revision": 1,
"ruby_source_path": "Formula/g/gofumpt.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [],
"version_head": "HEAD",
"version_stable": "0.10.0",
"versioned_formulae": [],
"why_use_this": null
}