← Back to Skills Marketplace
irook661

Go Linter Configuration

by irook661 · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
1854
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install go-linter-configuration
Description
Configure and troubleshoot golangci-lint for Go projects. Handle import resolution issues, type-checking problems, and optimize configurations for both local and CI environments.
README (SKILL.md)

Go Linter Configuration Skill

Configure and troubleshoot golangci-lint for Go projects. This skill helps handle import resolution issues, type-checking problems, and optimize configurations for both local and CI environments.

Installation

Install golangci-lint:

go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

Or use the official installation script:

curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.1

Basic Usage

Run linter on entire project:

golangci-lint run ./...

Run with specific configuration:

golangci-lint run --config .golangci.yml ./...

Configuration File (.golangci.yml)

Minimal Configuration (for CI environments with import issues)

run:
  timeout: 5m
  tests: false
  build-tags: []

linters:
  disable-all: true
  enable:
    - gofmt          # Format checking only

linters-settings:
  gofmt:
    simplify: true

issues:
  exclude-use-default: false
  max-issues-per-linter: 50
  max-same-issues: 3

output:
  format: tab

Standard Configuration (for local development)

run:
  timeout: 5m
  tests: true
  build-tags: []

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

linters-settings:
  govet:
    enable:
      - shadow
  errcheck:
    check-type-assertions: true
  staticcheck:
    checks: ["all"]

issues:
  exclude-use-default: false
  max-issues-per-linter: 50
  max-same-issues: 3

output:
  format: tab

Troubleshooting Common Issues

"undefined: package" Errors

Problem: Linter reports undefined references to imported packages Solution: Use minimal configuration with disable-all: true and only enable basic linters like gofmt

Import Resolution Problems

Problem: CI environment cannot resolve dependencies properly Solution:

  1. Ensure go.mod and go.sum are up to date
  2. Use go mod download before running linter in CI
  3. Consider using simpler linters in CI environment

Type-Checking Failures

Problem: Linter fails during type checking phase Solution:

  1. Temporarily disable complex linters that require type checking
  2. Use --fast flag for quicker, less intensive checks
  3. Verify all imports are properly declared

CI/CD Optimization

For GitHub Actions workflow:

name: Code Quality

on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - name: Set up Go
      uses: actions/setup-go@v4
      with:
        go-version: '1.21'
        cache: true

    - name: Download dependencies
      run: go mod download

    - name: Install golangci-lint
      run: |
        curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.1

    - name: Lint
      run: golangci-lint run --config .golangci.yml ./...

Linter Selection Guidelines

  • gofmt: For formatting consistency
  • govet: For semantic errors
  • errcheck: For unchecked errors
  • staticcheck: For static analysis
  • unused: For dead code detection
  • gosimple: For simplification suggestions
  • ineffassign: For ineffective assignments

Choose linters based on project needs and CI performance requirements.

Usage Guidance
This skill appears to do what it claims (configure and troubleshoot golangci-lint). Before installing: review any remote install scripts (don't blindly run curl | sh), prefer verified release downloads or your OS/package manager when possible, verify checksums for the Go tarball if you extract to /usr/local, and be aware installing to /usr/local may require sudo. No credentials are requested by the skill. If you want lower-risk setup, use your CI's official setup actions (e.g., actions/setup-go) or install golangci-lint via a package manager or by auditing the upstream install script first.
Capability Analysis
Type: OpenClaw Skill Name: go-linter-configuration Version: 1.0.0 The skill bundle includes installation steps in `SKILL.md` that involve downloading and executing remote scripts directly via `curl | sh` and `curl | tar`. Specifically, it installs Go from `golang.org` and `golangci-lint` from `raw.githubusercontent.com/golangci/golangci-lint/master/install.sh`. While these sources are official and the actions are for installing necessary tools, the direct execution of remote code is a high-risk behavior that bypasses package manager security and could be vulnerable to supply chain attacks if the remote source were compromised. No explicit malicious intent or prompt injection attempts were found.
Capability Assessment
Purpose & Capability
The skill's name/description (golangci-lint configuration and troubleshooting) matches its declared requirements (go and golangci-lint). The provided CI examples, config snippets, and troubleshooting steps align with that purpose and do not require unrelated capabilities.
Instruction Scope
Runtime instructions are focused on linting, configuration, and CI integration (golangci-lint run, go mod download, .golangci.yml suggestions). They also recommend using remote install scripts (curl | sh). The instructions do not request environment secrets or access other system credentials, but they do assume access to project files (go.mod/go.sum) and to write/install Go tooling.
Install Mechanism
Install steps use official hosts (golang.org and raw.githubusercontent.com for golangci-lint). However, both metadata and README recommend piping remote scripts into sh and extracting a tarball into /usr/local. While common, executing scripts directly from the network and extracting installers are moderate operational risks and should be audited before running.
Credentials
The skill declares no required environment variables, credentials, or config paths beyond the expected binaries. Nothing requests unrelated secrets or broad environment access.
Persistence & Privilege
The skill is not always-enabled and uses the platform default for invocation. Installation may write to /usr/local or the user's GOPATH and could require elevated privileges (sudo) depending on the chosen install method — this is normal for installing Go but worth noting.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install go-linter-configuration
  3. After installation, invoke the skill by name or use /go-linter-configuration
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of go-linter-configuration skill. - Provides guidance for configuring and troubleshooting golangci-lint in Go projects. - Covers solutions for import resolution and type-checking issues, and optimizing for local and CI environments. - Includes installation scripts for Go and golangci-lint. - Offers minimal and standard .golangci.yml templates tailored for CI or local usage. - Contains troubleshooting advice and recommended CI/CD workflow integration. - Lists core linter recommendations based on project use case.
Metadata
Slug go-linter-configuration
Version 1.0.0
License
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Go Linter Configuration?

Configure and troubleshoot golangci-lint for Go projects. Handle import resolution issues, type-checking problems, and optimize configurations for both local and CI environments. It is an AI Agent Skill for Claude Code / OpenClaw, with 1854 downloads so far.

How do I install Go Linter Configuration?

Run "/install go-linter-configuration" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Go Linter Configuration free?

Yes, Go Linter Configuration is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Go Linter Configuration support?

Go Linter Configuration is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Go Linter Configuration?

It is built and maintained by irook661 (@irook661); the current version is v1.0.0.

💬 Comments