golang-lint

Configure and run golangci-lint to enforce code quality in Go projects.

Updated Jun 15, 2026
One-click install
npx skills add https://github.com/2877389577/novels_ai_gen --skill golang-lint-2877389577
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: golang-lint
Source: https://github.com/2877389577/novels_ai_gen/tree/main/.agents/skills/golang-lint
Command: npx skills add https://github.com/2877389577/novels_ai_gen --skill golang-lint-2877389577

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires go, golangci-lint, and includes references (resource) and assets (resource) components.

What problem does it solve? Go projects accumulate lint warnings, inconsistent formatting, and unchecked errors when linting is not configured as a first-class workflow step. This Skill provides a production-ready golangci-lint v2 configuration, guidance on interpreting lint output, and rules for when to fix versus suppress warnings. ## Core Features & Use Cases - Configuration Setup: Provides a recommended .golangci.yml with 48 linters organized by domain (correctness, style, complexity, performance, security, testing) plus per-linter settings and documented disable rationales. - Warning Suppression Discipline: Enforces //nolint:linter // justification syntax, comma-separated multi-linter suppression, and the nolintlint meta-linter to prevent bare suppressions. - Legacy Codebase Adoption: Uses issues.new-from-rev for incremental linting and parallel sub-agents to clean up large backlogs by linter category. - Use Case: A team adopting golangci-lint on a legacy monorepo with 2000+ warnings can lint only new code, auto-fix with --fix, and triage remaining issues by category without drowning in noise. ## Quick Start Ask the agent to set up golangci-lint for your Go project with a recommended .golangci.yml and run it on the codebase.

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 for a Go project?▼

Create a .golangci.yml file with version: "2" at the top, list linters under linters.enable, and configure formatters like gofumpt under formatters.enable. Set run.timeout and per-linter options under linters.settings as needed.

How do I suppress a golangci-lint warning with nolint?▼

Add //nolint:lintername on the flagged line with a justification comment, for example //nolint:errcheck // fire-and-forget logging. Never use bare //nolint, and enable the nolintlint linter to enforce this automatically.

Which linters should I enable first in golangci-lint?▼

Prioritize correctness linters: govet, staticcheck, errcheck, and unused catch real bugs. Add at least one security linter like bodyclose or gosec, then layer in style and complexity linters as the team adapts.

How do I adopt golangci-lint on a legacy codebase with thousands of warnings?▼

Set issues.new-from-rev in .golangci.yml to lint only new or changed code, run golangci-lint run --fix for auto-fixable issues, then clean up remaining warnings incrementally by linter category.

Why does golangci-lint report config errors after upgrading to v2?▼

golangci-lint v2 changed the configuration format, requiring version: "2" and a separate formatters section. Run golangci-lint migrate to automatically convert a v1 config to the v2 format.

When should I not suppress a lint warning in Go?▼

Never suppress security and resource linters like gosec, bodyclose, or sqlclosecheck without strong justification, since they catch real leaks and vulnerabilities. Fix errcheck warnings on production code paths instead of suppressing them.