liveBook · Manning

Golangci-lint

As explained in Shipping Go: Develop, deliver, discuss, design, and go again

golangci-lint is an extensible Go linter that aggregates multiple linters and static-analysis checks behind a single command.

When a Go pipeline needs broader feedback than go vet alone, golangci-lint aggregates multiple linters and static checks behind one command. It can run alongside formatting, vetting, and tests so teams find more problems sooner, trading additional computation for shorter feedback cycles. section 5.4

A practical setup combines selection, security checking, and automation:

  • Create .golangci.yml at the repository root and enable checks such as gosec. section 5.4

How Shipping Go: Develop, deliver, discuss, design, and go again covers it

How deep it goes
Explains installation, configuration, selected checks, security analysis, and CI integration without detailing individual linter internals.
Examples
Uses a .golangci.yml file, gosec, golangci-lint run, a pinned installation, and a CI lint job.
What it assumes
Assumes Go development and pipeline familiarity while extending basic go vet checks through configuration and selected linters.
What you can do after
Operate golangci-lint locally and in CI to detect unused code, ineffective assignments, missing error checks, and security issues.
How it connects
Connects linting with Go vet, static code analysis, security analysis, continuous integration, and automated testing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Shipping Go: Develop, deliver, discuss, design, and go again. The section links point to the parts of the book it draws on.