go-linting

Solid

Use when setting up linting for a Go project, configuring golangci-lint, picking a linter set, suppressing findings with //nolint, or wiring lint checks into CI. Apply proactively whenever a project lacks .golangci.yml, when lint output is unclear, or when a new package needs the project's quality bar. Does not cover code review process (see go-code-review).

Code & Development 8 stars 1 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
32
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Go Linting The single most important property of a linting setup is **consistency**: every contributor and every CI run uses the same rules. `golangci-lint` is the tool; a checked-in `.golangci.yml` is the contract. ## Core Rules 1. **Every Go project has a `.golangci.yml`** at the repository root. It is the source of truth for which linters run. 2. **Lint runs in CI on every PR.** A green build means lint is green. 3. **Lint runs locally before commit.** A pre-commit hook or `make lint` keeps the feedback loop fast. 4. **Suppress with reasons.** `//nolint:linter // why` — never bare `//nolint`. 5. **Fix the cause first.** A suppression should be the last resort, not the default reaction. 6. **Never silence security linters** (`gosec`, `bodyclose`, `sqlclosecheck`) without a strong, documented reason. ## Setup Procedure 1. Install: `go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest` (or `brew install golangci-lint`). 2. Drop a baseline [`.golangci.yml`](assets/.golangci.yml) at the repo root. 3. Run `golangci-lint run ./...`. 4. Fix the findings in order — formatting first, `govet` next, style last. 5. Re-run until clean. Commit `.golangci.yml` and any source fixes together. 6. Add the CI workflow (see [references/ci-integration.md](references/ci-integration.md)). ## Minimum Linter Set These five catch the most common issues and have the lowest noise rate. Start here: | Linter | Catches | |---|---| | `errcheck` | Unchecked error returns | | `g...

Details

Author
muratmirgun
Repository
muratmirgun/gophers
Created
2 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Solid

golang-lint

Linting best practices and golangci-lint configuration for Golang projects — running linters, configuring .golangci.yml, suppressing warnings with nolint directives, interpreting lint output, and selecting linters. Use when configuring golangci-lint, asking about lint warnings or nolint suppressions, setting up code quality tooling, or choosing linters. Also use when the user mentions golangci-lint, go vet, staticcheck, or revive.

2 Updated 4 days ago
marcioaltoe
Code & Development Listed

golang-lint

Provides linting best practices and golangci-lint configuration for Go projects. Covers running linters, configuring .golangci.yml, suppressing warnings with nolint directives, interpreting lint output, and managing linter settings. Use this skill whenever the user runs linters, configures golangci-lint, asks about lint warnings or suppressions, sets up code quality tooling, or asks which linters to enable for a Go project. Also use when the user mentions golangci-lint, go vet, staticcheck, revive, or any Go linting tool.

0 Updated yesterday
guynhsichngeodiec
Code & Development Listed

linting

Use when fixing machine-detectable code issues — run linters and static analyzers (ESLint, Ruff, Clippy, golangci-lint), resolve findings, suppress false positives with justification, tighten config. Automated quality gate, distinct from human-judgment review. Triggers on "lint", "linting", "fix eslint", "static analysis", "lint 修复", "静态分析", "格式检查", "代码规范检查". Not for human-judgment code review (use code-review), runtime behavior bugs (use debugging), or behavior-preserving structural refactoring (use refactoring).

3 Updated 2 days ago
int2t05