golang-lint

Configure and run golangci-lint to enforce Go code quality and suppress warnings correctly.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Go projects accumulate lint warnings without a consistent configuration, and developers often suppress warnings incorrectly with bare //nolint directives or disable valuable linters. This Skill provides a production-ready golangci-lint v2 configuration, clear rules for when to fix versus suppress warnings, and workflows for adopting linting on legacy codebases. ## Core Features & Use Cases - Recommended Configuration: Ships a .golangci.yml with 48 linters organized by domain (correctness, style, complexity, performance, security, testing) plus explicit disable rationales for noisy linters. - Nolint Hygiene: Enforces specific, justified //nolint directives via the nolintlint meta-linter, with patterns for single-line, multi-linter, and per-function suppression. - Legacy Adoption: Uses issues.new-from-rev to lint only new code and parallel sub-agents to clean up existing warnings by category. - Use Case: A team inheriting a Go monorepo with 2000+ lint warnings can apply the recommended config, set new-from-rev to stop the bleeding on new code, and batch-fix security and error-handling findings first. ## Quick Start Ask the agent to set up golangci-lint for your Go project using the recommended configuration and run it on your 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 with version: "2" at the top, list linters under linters.enable, and put formatters like gofumpt under formatters.enable. Set run.timeout for large repos and configure per-linter options under linters.settings.

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, and avoid redundant pairs like gocyclo with cyclop.

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, then run golangci-lint run --fix for auto-fixable issues. Clean up remaining warnings gradually by category rather than mass-suppressing with nolint.

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

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

When should I not suppress a lint warning?▼

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