# 使用 Homebrew, Nix, pacman 安装 gofumpt

查看 gofumpt 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:gofumpt
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install gofumpt
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#gofumpt
```

  证据: nixpkgs package indexes: pkgs/by-name/go/gofumpt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S gofumpt
```

  证据: Arch Linux sync databases: gofumpt from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

## 软件包事实

- **软件包键:** brew:gofumpt
- **软件包管理器:** Homebrew
- **版本:** 0.11.0
- **来源摘要:** Stricter gofmt
- **主页:** <https://github.com/mvdan/gofumpt>
- **仓库:** <https://github.com/mvdan/gofumpt>
- **最后更新:** 2026-07-27T14:57:51+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- gofumpt (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.11.0
## 项目历史与用法

gofumpt is a stricter Go formatter that remains compatible with gofmt output. It accepts a narrower formatting style and can be used as a drop-in command for formatting Go source.

The project occupies a practical niche between the Go toolchain's conservative formatter and teams that want more consistent source layout without maintaining custom formatter rules.

### 项目历史

The repository began in March 2019 by importing source from cmd/gofmt and adding the first stricter formatting rules. The README continues to describe the tool as a fork of gofmt with added rules implemented in the format package.

The first release, v0.1.0 in January 2021, documented the features that had worked for more than a year. Later releases track Go formatter changes: v0.3.0 was based on Go 1.18's gofmt, v0.5.0 vendored Go formatting packages for stable behavior across build toolchains, and v0.10.0 was based on Go 1.26's gofmt.

### 采用历史

gofumpt spread through Go editor and CI workflows because it preserves gofmt compatibility while reducing formatting latitude. Its README presents it as a drop-in formatter, and the changelog notes that gopls supports gofumpt natively.

Package-manager adoption followed that formatter role: the input package facts list Homebrew, Nix, and pacman names, reflecting use across developer workstations rather than as a service dependency.

### 使用方式

The common command-line pattern is gofumpt -l -w . for listing and rewriting formatted files. The README documents skipped vendor and testdata directories unless passed explicitly, and generated files only receive added rules when passed explicitly.

Teams usually run gofumpt in pre-commit hooks, CI checks, or editor format-on-save paths. Library users can also call the format package when they need gofumpt behavior inside Go tooling.

### 为什么软件包爱好者会关心

gofumpt is package-nerd catnip because it is deliberately boring: it extends gofmt without rejecting gofmt's social contract. That made it acceptable in environments where arbitrary style formatters would be too divisive.

Its release history tracks Go's own formatter internals, so package maintainers care about which Go release a gofumpt version is based on. The vendoring change in v0.5.0 is especially important because it made output less dependent on the compiler used to build the binary.

### 时间线

- 2019: Repository starts with cmd/gofmt source and first stricter formatting rules.
- 2021: v0.1.0 documents the first released rule set and deprecates gofumports.
- 2022: v0.3.0 bases the formatter on Go 1.18's gofmt and adds concurrency-related speedups.
- 2023: v0.5.0 vendors Go formatting packages for stable formatter output.
- 2026: v0.10.0 bases the formatter on Go 1.26's gofmt and adds rule selection for extra rules.

### Related projects

- gofmt is the upstream formatter model and source base.
- gopls, the Go language server, provides editor integration that can apply gofumpt behavior.
- goimports is related in editor workflows because it formats Go code while managing imports.

### 来源

- <https://github.com/mvdan/gofumpt>
- <https://github.com/mvdan/gofumpt#readme>
- <https://github.com/mvdan/gofumpt/blob/master/CHANGELOG.md>


## 安全说明

没有找到 gofumpt 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。


## 其他软件包管理器记录

- Nix - gofumpt: normalized package name match | nixpkgs package indexes: pkgs/by-name/go/gofumpt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - gofumpt - 0.10.0-1: normalized package name match | Arch Linux sync databases: gofumpt from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A strict formatter for Go language | https://github.com/mvdan/gofumpt


## Combined YAML source

View the package source record on GitHub. [combined/gofumpt.yml](https://github.com/mxcl/pkgdb/blob/main/combined/gofumpt.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
