golang-lint

Configure golangci-lint with `.golangci.yml` and interpret lint output.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you enforce strong Go code quality by configuring golangci-lint, running targeted lint passes, and making safe decisions about fixing versus suppressing warnings.

Core Features & Use Cases

  • golangci-lint configuration: Create and maintain a .golangci.yml that defines enabled/disabled linters, timeouts, concurrency, and formatting behavior.
  • nolint hygiene and interpretation: Explain lint output, identify the linter that triggered each issue, and apply //nolint:<linter> // reason suppressions correctly when appropriate.
  • Workflow for new vs legacy code: Support incremental adoption using issues.new-from-rev plus strategies for parallel cleanup by issue category.

A real-world use case is modernizing a large Go service where security/resource-leak findings (like bodyclose and sqlclosecheck) must be fixed first, while complexity/style issues (like funlen or gocyclo in orchestration/test code) may be fixed or selectively suppressed with clear justifications.

Quick Start

Ask an agent: "Set up .golangci.yml for this Go repo using the recommended lint profile, then explain the top 20 golangci-lint findings and propose fixes or properly justified nolint directives."

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 analyze my Go code quality?

Configure golangci-lint by creating a `.golangci.yml` file to define enabled linters, timeouts, concurrency, and formatting behavior. This configuration acts as the central rule set for enforcing code quality standards across your Go repository.

What is the correct way to suppress a golangci-lint warning?

Suppress a golangci-lint warning by adding a `//nolint:<linter> // justification` directive directly in the code. This nolint hygiene practice ensures the specific linter is bypassed while providing a clear, documented reason for the suppression.

How do I interpret golangci-lint output for security and resource leaks?

Interpret golangci-lint output by parsing the reported issues tied to specific linter names, such as `bodyclose` and `sqlclosecheck`. Identifying the triggering linter helps categorize security and resource-leak findings for immediate remediation.

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

Adopt golangci-lint on legacy code incrementally using the `issues.new-from-rev` configuration to surface findings only in new commits. This allows parallel cleanup of existing complexity and style issues without blocking development.

Should I fix a golangci-lint warning or use a nolint directive?

Decide between fixing and suppressing based on the linter category: fix correctness, security, and resource-leak findings immediately, while complexity or style issues like `funlen` may be selectively suppressed with properly justified nolint directives.