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-09-01 09:39:14
最后一次提交2025-03-17 22:13:24
發布數183
最新版本名稱v2.4.0 (發布於 )
第一版名稱v1 (發布於 )
用户参与
星數17.6k
關注者數104
派生數1.5k
提交數3.7k
已啟用問題?
問題數1814
打開的問題數89
拉請求數3218
打開的拉請求數25
關閉的拉請求數579
项目设置
已啟用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