go-linting

Automate Go linting setup with golangci-lint and multiple linters.

139|17|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/cxuu/golang-skills --skill go-linting-cxuu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-linting
Source: https://github.com/cxuu/golang-skills/tree/main/skills/go-linting
Command: npx skills add https://github.com/cxuu/golang-skills --skill go-linting-cxuu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps teams establish and maintain consistent Go code quality by recommending a robust linting setup using popular tools like golangci-lint, along with per-project configuration guidance.

Core Features & Use Cases

  • Recommends a minimal, practical set of linters (errcheck, goimports, revive, govet, staticcheck) and a unified golangci-lint config.
  • Provides example configuration and integration tips for CI/CD to enforce linting across the codebase.
  • Suitable for new Go projects and mature repositories aiming to standardize code quality practices.

Quick Start

Install and apply the recommended linting configuration to your Go project to start enforcing consistent style and error checks.

Frequently Asked Questions about go-linting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up golangci-lint for a Go project?

You can set up Go linting by applying a unified golangci-lint configuration that enables linters like errcheck, goimports, revive, govet, and staticcheck across your packages. This provides a minimal, practical setup to enforce consistent code quality.

What Go linters should I use for static analysis?

A recommended minimal set of Go linters includes errcheck, goimports, revive, govet, and staticcheck. Running these through golangci-lint catches unchecked errors, formats imports, and enforces style conventions.

How do I integrate Go linting into a CI/CD pipeline?

Go linting integrates into CI/CD pipelines by running golangci-lint with a shared configuration file during builds. This automatically enforces code quality checks across the codebase before changes are merged.

Can I use golangci-lint with an existing mature Go repository?

Yes, golangci-lint works for both new Go projects and mature repositories. Applying the recommended configuration helps standardize code quality practices without requiring a full rewrite of existing code.

What is the best way to enforce Go code quality across packages?

The best way to enforce Go code quality is using golangci-lint as a unified runner with a configured set of linters like staticcheck and govet. This automates style and error checking across all packages locally and in CI.

Why does staticcheck report errors in my Go code?

Staticcheck reports errors to identify Go code improvements, such as simplifying code and catching bugs. Integrating staticcheck within your golangci-lint configuration ensures these static analysis checks are consistently applied.