Skip to content

golangci-lint

What

golangci-lint is a Go linters aggregator. It runs linters in parallel, uses caching, supports yaml config, has integrations with all major IDE and has dozens of linters included.

Why

Provides Secure Application Security Testing, error, style etc. checks for your codebase.

Tip

See supported linters here.

How

Linters can be configured via command-line options or a configuration file.

CI setup

Summary

No configuration required.

golangci-lint will be executed via the pre-commit Github workflow in .github/workflows/pre-commit.yml.

Local setup

Done

This is already configured for you via pre-commit.

For custom configurations on how golangci-lint runs see the configuration guide.

You may want to disable linters that might be too strict (e.g: exhaustivestruct) or add some rules around how it should behave. This can be done via linter configuration.