# 使用 Homebrew, MacPorts, Nix 安装 go-critic

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

## 安装

```sh
sudo av install brew:go-critic
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install go-critic
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install go-critic
```

  证据: MacPorts ports tree: devel/go-critic/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#go-critic
```

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

## 软件包事实

- **软件包键:** brew:go-critic
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/go-critic>
- **版本:** 0.14.4
- **来源摘要:** Opinionated Go source code linter
- **主页:** <https://go-critic.com>
- **仓库:** <https://github.com/go-critic/go-critic>
- **上游文档:** <https://go-critic.com/>
- **许可证:** MIT
- **源码归档:** <https://github.com/go-critic/go-critic/archive/refs/tags/v0.14.4.tar.gz>
- **最后更新:** 2026-06-25T00:11:38Z
- **已生成:** 2026-07-08T07:18:31+00:00

## 可执行文件

- gocritic (cli)
- gocritic (别名)

## 依赖

- go

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 0.14.4
- 管理器更新时间: 2026-06-25
- 本地数据: OK
- 上游仓库: https://github.com/go-critic/go-critic
- 检测到的最新版本: v0.14.4 (当前)
## 项目历史与用法

go-critic is an opinionated static-analysis linter for Go source code. It collects diagnostics, style checks, performance checks, and experimental rules that are often missing from smaller, single-purpose Go linters.

### 项目历史

The go-critic repository was created in 2018 and the project was announced that year as both a linter and a sandbox for prototyping static-analysis ideas. Its documentation describes project goals around providing useful checks, proving check implementations before proposing them elsewhere, and keeping useful checks that lack a better home.

### 采用历史

go-critic became part of the broader Go linting ecosystem through direct CLI use and through golangci-lint, whose go-critic entry exposes it as `gocritic`. The repository README tells most users that using go-critic under golangci-lint is enough, reflecting its role as a specialized checker set inside larger lint pipelines.

### 使用方式

Practitioners run `go-critic check` against packages, directories, or files, enabling and disabling individual checks or tag groups such as diagnostic, style, performance, experimental, opinionated, and security. The CLI also includes `doc` for checker documentation and checker-specific parameters, which makes it useful both as a standalone audit tool and as a source of extra rules in CI.

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

For package catalogs, go-critic represents the Go ecosystem's preference for composable command-line analyzers. It can be installed as a small binary, run directly, or consumed by a linter runner, which lets distributions package it without owning editor or CI integration logic.

### 时间线

- 2018: The GitHub repository was created and the linter was announced.
- 2019: v0.3.4 and v0.4.0 releases appeared on GitHub.
- 2020: v0.4.x releases continued the checker-set expansion.
- 2026: v0.14.x releases documented continued maintenance.

### Related projects

- golangci-lint
- ruleguard
- go vet
- staticcheck

### 来源

- <https://github.com/go-critic/go-critic>
- <https://github.com/go-critic/go-critic/releases>
- <https://go-critic.com/>
- <https://go-critic.com/overview.html>
- <https://golangci-lint.run/docs/product/thanks/>


## 安全说明

library-like package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- library-like package without higher-risk signals

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** go-critic
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

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

- Nix - go-critic: normalized package name match | nixpkgs package indexes: pkgs/by-name/go/go-critic/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - go-critic: normalized package name match | MacPorts ports tree: devel/go-critic/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/zh-hans/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/zh-hans/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Language runtime packages](https://www.automicvault.com/zh-hans/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [go](https://www.automicvault.com/zh-hans/pkg/brew/go/) - Runtime dependency declared by Homebrew.
- [staticcheck](https://www.automicvault.com/zh-hans/pkg/brew/staticcheck/) - Shares av.db curated category or tags: cli, code-quality, developer-tools, go, linter.
- [revive](https://www.automicvault.com/zh-hans/pkg/brew/revive/) - Shares av.db curated category or tags: cli, code-quality, developer-tools, go, linter.
- [errcheck](https://www.automicvault.com/zh-hans/pkg/brew/errcheck/) - Shares av.db curated category or tags: cli, developer-tools, go, linter, static-analysis.
- [eslint](https://www.automicvault.com/zh-hans/pkg/brew/eslint/) - Shares av.db curated category or tags: cli, code-quality, developer-tools, linter, static-analysis.
- [luacheck](https://www.automicvault.com/zh-hans/pkg/brew/luacheck/) - Shares av.db curated category or tags: cli, code-quality, developer-tools, linter, static-analysis.
- [pmd](https://www.automicvault.com/zh-hans/pkg/brew/pmd/) - Shares av.db curated category or tags: cli, code-quality, developer-tools, linter, static-analysis.
- [pylint](https://www.automicvault.com/zh-hans/pkg/brew/pylint/) - Shares av.db curated category or tags: cli, code-quality, developer-tools, linter, static-analysis.
- [selene](https://www.automicvault.com/zh-hans/pkg/brew/selene/) - Shares av.db curated category or tags: cli, code-quality, developer-tools, linter, static-analysis.

## Combined YAML source

View the package source record on GitHub. [combined/go-critic.yml](https://github.com/automic-vault/db/blob/main/combined/go-critic.yml)


## 来源

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
