golang-lint

Configure golangci-lint v2 and manage nolint suppressions for Go code.

1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/dashkan/pivox --skill golang-lint-dashkan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-lint
Source: https://github.com/dashkan/pivox/tree/main/.agents/skills/golang-lint
Command: npx skills add https://github.com/dashkan/pivox --skill golang-lint-dashkan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) and evals (resource) components.

What problem does it solve?

This Skill helps you reduce Go bugs and improve code quality by configuring and interpreting golangci-lint correctly, so lint findings lead to real fixes rather than guesswork or unmaintained suppressions.

Core Features & Use Cases

  • .golangci.yml configuration guidance: choose and tune linters for correctness, style, complexity, performance, security, and logging.
  • nolint hygiene: suppress lint warnings only with specific linter names and clear justifications, enforced via nolintlint.
  • Output interpretation and remediation: understand what each lint message means, decide whether to fix or suppress, and apply safe patterns.
  • Incremental adoption workflow: adopt linting on legacy code using issues.new-from-rev and staged cleanup with focused categories.

Quick Start

Ask your AI assistant to configure your .golangci.yml for golangci-lint v2 and then explain how to run golangci-lint, interpret the warnings, and write correct //nolint directives for any false positives.

Frequently Asked Questions about golang-lint

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure golangci-lint v2 using a .golangci.yml file?

Configure golangci-lint v2 by generating a .golangci.yml file to select and tune linters for correctness, security, and style. This setup provides guidance on interpreting lint output and applying safe remediation patterns for Go code.

How do I suppress Go lint warnings with nolint directives correctly?

Suppress Go lint warnings by writing nolint directives that specify exact linter names and clear justifications. Enforcing nolint hygiene through nolintlint rules prevents unmaintained suppressions and ensures lint findings lead to real fixes.

What is the best way to incrementally adopt golangci-lint on a legacy Go codebase?

Incrementally adopt golangci-lint on legacy Go code by using the new-from-rev setting to lint only new changes. This workflow supports staged cleanup with focused linter categories, reducing the burden of fixing historical violations all at once.

How do I interpret and fix errcheck, bodyclose, or gocyclo lint failures in Go?

Interpret errcheck, bodyclose, or gocyclo failures by understanding that these linters target unchecked errors, unclosed HTTP bodies, and high cyclomatic complexity. Apply linter-specific fixing patterns or safe suppressions to resolve the exact lint messages.

Can I use golangci-lint to enforce both security and code quality in CI pipelines?

Yes, you can enforce security and code quality in CI pipelines by configuring golangci-lint with dedicated security linters. The configuration supports integrating static analysis into CI workflows to catch bugs and vulnerabilities before shipping Go code.