Skip to content
Back to skills

Golangci

ASecurity

Configure and run golangci-lint

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 7, 2026
code-qualitygobashgitperformance

Works with

  • cli

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add JamesPrial/claudefiles --skill golangci --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Golangci?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Golangci
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jamesprial-golangci/badge)](https://www.skillsdirectory.com/skills/jamesprial-golangci)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: golangci-lint
description: Configure and run golangci-lint
---

# golangci-lint

Meta-linter that runs multiple linters in parallel.

## Install
```bash
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
```

## Usage
```bash
golangci-lint run
golangci-lint run ./...
golangci-lint run --fix
```

## Basic Configuration
```yaml
# .golangci.yml
run:
  timeout: 5m
  tests: true

linters:
  enable:
    - gofmt
    - govet
    - staticcheck
    - errcheck
    - gosimple
    - ineffassign
    - unused

linters-settings:
  errcheck:
    check-blank: true
  govet:
    check-shadowing: true
```

## Recommended Linters
```yaml
linters:
  enable:
    - gofmt       # Format check
    - govet       # Built-in analyzer
    - staticcheck # Comprehensive checks
    - errcheck    # Unchecked errors
    - gosimple    # Simplification
    - ineffassign # Ineffective assignments
    - unused      # Unused code
    - revive      # Fast configurable linter
    - gocyclo     # Cyclomatic complexity
    - misspell    # Spelling errors
```

## Exclude Patterns
```yaml
issues:
  exclude-rules:
    - path: _test\.go
      linters:
        - errcheck
        - gosec
    - text: "should have comment"
      linters:
        - revive
```

## CI Integration
```bash
# GitHub Actions
golangci-lint run --out-format=github-actions

# GitLab CI
golangci-lint run --out-format=code-climate > gl-code-quality-report.json
```

## Common Fixes

### errcheck: Unchecked Error
```go
// Bad
file.Close()

// Good
defer file.Close()
```

### gosimple: Redundant Code
```go
// Bad
for i, _ := range items

// Good
for i := range items
```

### ineffassign: Ineffective Assignment
```go
// Bad
result := compute()
result = other()

// Good
result := other()
```

## Performance Tuning
```yaml
run:
  concurrency: 4
  deadline: 5m
  skip-dirs:
    - vendor
    - third_party
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…