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


Overview

Name With Ownergolangci/golangci-lint
Primary LanguageGo
Program languageGo (Language Count: 4)
PlatformDocker, Linux, Mac, Windows
License:GNU General Public License v3.0
Release Count141
Last Release Namev1.58.0 (Posted on )
First Release Namev1 (Posted on )
Created At2018-05-04 13:41:15
Pushed At2024-05-07 00:28:35
Last Commit At2024-05-07 02:26:34
Stargazers Count14.5k
Watchers Count98
Fork Count1.3k
Commits Count2.9k
Has Issues Enabled
Issues Count1572
Issue Open Count128
Pull Requests Count2398
Pull Requests Open Count23
Pull Requests Close Count427
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
To the top