golang-lint

Configure golangci-lint with .golangci.yml and nolint directives for Go projects.

Updated Oct 1, 2024
One-click install
npx skills add https://github.com/mrlorentx/.files --skill golang-lint-mrlorentx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-lint
Source: https://github.com/mrlorentx/.files/tree/main/ai/claude/skills/golang-linter
Command: npx skills add https://github.com/mrlorentx/.files --skill golang-lint-mrlorentx

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Go projects often suffer from inconsistent lint configurations, leading to undetected quality issues and higher maintenance overhead.

Core Features & Use Cases

  • Produces a production-ready golangci-lint configuration (.golangci.yml) with a curated set of linters and per-linter options.
  • Provides guidance on suppressing warnings with precise //nolint directives and how to interpret lint output in CI and local development.
  • Applies to Go projects of all sizes, from libraries to large services, to enforce consistent code quality and style.

Quick Start

Configure your first .golangci.yml using the recommended template and run golangci-lint to scan the project.

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?

You configure golangci-lint by generating a production-ready .golangci.yml file with a curated set of linters, per-linter settings, formatters, and issues rules to enforce consistent code quality across your Go project.

What is the best way to suppress golangci-lint warnings in Go code?

The best way to suppress golangci-lint warnings is by applying precise //nolint directives in your Go code, which allows you to ignore specific lint issues while maintaining overall static analysis strictness.

Can I use golangci-lint in CI pipelines for Go projects?

Yes, you can use golangci-lint in CI pipelines to interpret lint output and enforce code quality standards across Go projects of varying sizes, from libraries to large services.

Why do I need a .golangci.yml file for static analysis?

You need a .golangci.yml file for static analysis because Go projects often suffer from inconsistent lint configurations, and this file provides a standardized setup to detect quality issues and reduce maintenance overhead.

Does golangci-lint work with large Go services and libraries?

Yes, golangci-lint works with large Go services and libraries by applying a structured development workflow with linter selection and issues rules that scale across projects of all sizes.