golangci-lint

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

Github stars Tracking Chart

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


Main metrics

Overview
Name With Ownergolangci/golangci-lint
Primary LanguageGo
Program languageGo (Language Count: 4)
PlatformDocker, Linux, Mac, Windows
License:GNU General Public License v3.0
所有者活动
Created At2018-05-04 13:41:15
Pushed At2025-06-08 21:17:00
Last Commit At2025-03-17 22:13:24
Release Count177
Last Release Namev2.1.6 (Posted on )
First Release Namev1 (Posted on )
用户参与
Stargazers Count17.1k
Watchers Count104
Fork Count1.5k
Commits Count3.6k
Has Issues Enabled
Issues Count1781
Issue Open Count90
Pull Requests Count3119
Pull Requests Open Count22
Pull Requests Close Count557
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

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