golang-lint

Configure golangci-lint with a maintainable .golangci.yml for Go projects.

2|Updated Feb 12, 2024
One-click install
npx skills add https://github.com/adibfirman/dotfiles --skill golang-lint-adibfirman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-lint
Source: https://github.com/adibfirman/dotfiles/tree/main/claude/.claude/skills/technical/golang/golang-lint
Command: npx skills add https://github.com/adibfirman/dotfiles --skill golang-lint-adibfirman

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you prevent and fix real Go issues by configuring golangci-lint, running it effectively, and handling lint findings (especially nolint) with discipline.

Core Features & Use Cases

  • Production .golangci.yml setup: establishes the “source of truth” configuration for correctness, style, complexity, performance, security, and testing.
  • Fast, targeted linting for development: supports an iterative workflow for new code and modified files, including optional auto-fixes.
  • Reliable nolint practices: teaches when suppression is appropriate and enforces correct syntax and justifications (nolintlint).
  • Meaningful lint interpretation: explains how to read golangci-lint output and map each finding to the right linter and remediation path.

Quick Start

Use the golang-lint skill to configure and run golangci-lint on your Go project so you get actionable lint results and correctly justified nolint 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 improve Go code quality?

To improve Go code quality, configure golangci-lint with a maintainable .golangci.yml file as your project's source of truth. This setup organizes linters.enable/disable rules, distinguishes formatters from linters, and enforces version: "2" technical requirements for reliable linting across correctness, style, complexity, performance, and security.

What is the correct way to use //nolint directives in Go?

The correct way to use //nolint directives in Go is to apply them only when suppression is appropriate and necessary. You must enforce correct syntax and provide explicit justifications using nolintlint, ensuring that nolint hygiene is validated and lint findings are resolved with discipline rather than ignored.

How do I run incremental linting on modified Go files during development?

To run incremental linting on modified Go files during development, use golangci-lint with an iterative workflow targeting new code. You can apply optional auto-fixes using the --fix flag to resolve findings quickly while keeping your production .golangci.yml configuration as the validating source of truth.

Does golangci-lint support security linters for CI pipelines?

Yes, golangci-lint supports security linters for CI pipelines by establishing a production .golangci.yml configuration that includes security checks. This setup ensures reliable linting in CI environments, mapping each finding to the correct linter and providing a clear remediation path for identified vulnerabilities.

Why is nolintlint important for Go lint configuration?

nolintlint is important for Go lint configuration because it validates nolint hygiene by enforcing correct syntax and requiring justifications for suppressions. It prevents unchecked //nolint directives from masking real issues, ensuring that lint findings are resolved with discipline and technical requirements are met.

What's the best way to interpret golangci-lint output and map findings to linters?

The best way to interpret golangci-lint output is to read the findings and map each issue to its specific originating linter and remediation path. Meaningful lint interpretation requires understanding your .golangci.yml configuration to identify whether findings relate to correctness, style, complexity, performance, security, or testing.