添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
);}}

golangci-lint

Install

CI installation

Most installations of golangci-lint are performed for CI.

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 option --enable-all and a new linter is added or even without --enable-all when one upstream linter is upgraded.

IMPORTANT : It's highly recommended installing a specific version of golangci-lint available on the releases page .

GitHub Actions

We recommend using our GitHub Action for running golangci-lint in CI for GitHub projects.

It's fast and uses smart caching inside, and it can be much faster than the simple binary installation.

Other CI

Here is the other way to install golangci-lint:

# binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.1
# or install it into ./bin/
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.59.1
# In Alpine Linux (as it does not come with curl by default)
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.59.1
golangci-lint --version

It is advised that you periodically update the version of golangci-lint as the project is under active development