golang-lint

Configure and run golangci-lint to detect issues in Go projects.

1|Updated May 26, 2026
One-click install
npx skills add https://github.com/tokiou/caba-inseguridad-v2-be --skill golang-lint-tokiou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-lint
Source: https://github.com/tokiou/caba-inseguridad-v2-be/tree/main/.claude/skills/golang-lint
Command: npx skills add https://github.com/tokiou/caba-inseguridad-v2-be --skill golang-lint-tokiou

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

It helps you catch real bugs, resource leaks, and quality regressions in Go code early by configuring and running golangci-lint with the right set of linters and a maintainable suppression strategy.

Core Features & Use Cases

  • Production-grade configuration guidance: establish and maintain a .golangci.yml as the source of truth for which checks run and how they’re tuned.
  • Setup and governance for linters: choose linters, enable/disable them intentionally, and keep formatting handled by the right sections (formatters vs linters).
  • Interpretation and safe handling of violations: map lint output back to specific linters, decide when to fix vs when to suppress, and write correct //nolint:<linter> // justification directives (with nolintlint enforcement).
  • Incremental adoption on legacy code: lint only new/changed code and progressively clean up without drowning in thousands of pre-existing findings.
  • Fast iteration for coding changes: run targeted linting with auto-fix on modified files (while you continue implementing the feature).

Quick Start

Ask your agent to set up and run golangci-lint for your Go project using a .golangci.yml and then interpret any reported issues by linter name to decide whether to fix or to apply justified //nolint:<linter> suppressions.

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 to catch bugs and resource leaks in my Go project?

You configure golangci-lint by establishing a `.golangci.yml` file as the source of truth to select linters and tune their settings, enabling the detection of bugs, style problems, and resource leaks across your Go project.

What's the best way to start linting a legacy Go codebase without drowning in existing violations?

The best way to lint legacy Go code is through incremental adoption, configuring golangci-lint to lint only new or changed code so you can progressively clean up violations without being overwhelmed by thousands of pre-existing findings.

How do I properly suppress a golangci-lint violation using nolint directives?

You suppress a golangci-lint violation by writing a `//nolint:<linter> // justification` directive, ensuring you provide a specific justification for the suppression which can be enforced by the `nolintlint` linter.

Does golangci-lint v2 require a different configuration structure than previous versions?

Yes, golangci-lint v2 requires a correct configuration structure in your `.golangci.yml`, specifically separating formatters from linters to ensure formatting is handled by the right sections of the configuration file.

Why does my golangci-lint run timeout before finishing on a large Go repository?

Golangci-lint runs may timeout on large repositories due to heavy analysis loads, but you can resolve this by adjusting timeout settings in your configuration or by running targeted linting on modified files during fast iteration.

Can I auto-fix Go lint issues directly in my IDE while coding?

Yes, you can auto-fix Go lint issues while coding by running targeted linting with the auto-fix feature on modified files, allowing you to continue implementing features while resolving reported style and complexity issues.