golangci-lint

用于 Go 的快速 linters 运行器。(Fast linters Runner for Go)

Github星跟踪图

golangci-lint

快速的 Go linters 运行器 / 聚合器。

golangci-lint 是一个快速的 Go linters 运行器。它可以并行运行 linters,使用缓存,支持 yaml 配置,与所有主流 IDE 集成,并包含数十种 linters。

特性

  • 速度非常快:并行运行 linters,重复使用 Go 的构建缓存和缓存分析结果。
  • 基于 configuration 的配置。
  • 与 VS Code、GNU Emacs、Sublime Text 集成
  • 包含 48 个 linters,无需安装。
  • 因为调整了默认设置,所以误报率最低。
  • 漂亮的输出,包括颜色、源代码行和标记的标识符。

安装 golangci-lint

文档

文档托管在 https://golangci-lint.run


主要指标

概览
名称与所有者golangci/golangci-lint
主编程语言Go
编程语言Go (语言数: 4)
平台Docker, Linux, Mac, Windows
许可证GNU General Public License v3.0
所有者活动
创建于2018-05-04 13:41:15
推送于2025-06-08 21:17:00
最后一次提交2025-03-17 22:13:24
发布数177
最新版本名称v2.1.6 (发布于 )
第一版名称v1 (发布于 )
用户参与
星数17.1k
关注者数104
派生数1.5k
提交数3.6k
已启用问题?
问题数1781
打开的问题数90
拉请求数3119
打开的拉请求数22
关闭的拉请求数557
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

GolangCI-Lint

Build Status
GolangCI
License
Release
Docker

GolangCI-Lint is a linters aggregator. It's fast: on average 5 times faster than gometalinter.
It's easy to integrate and use, has nice output and has a minimum number of false positives. It supports go modules.

GolangCI-Lint has integrations with VS Code, GNU Emacs, Sublime Text.

Follow the news and releases on our twitter and our blog.

Sponsored by GolangCI.com: SaaS service for running linters on GitHub pull requests. Free for Open Source.

Demo

Short 1.5 min video demo of analyzing beego.
asciicast

Install

Binary

Most installations are done for CI (e.g. Travis CI, CircleCI). It's important to have reproducible CI:
don't start to fail all builds at the same time. With golangci-lint this can happen if you
use deprecated option --enable-all and a new linter is added or even without --enable-all: when one upstream linter is upgraded.

It's highly recommended to install a specific version of golangci-lint available on the releases page.

Here is the recommended way to install golangci-lint v1.23.6:

# binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh