Go Error Diagnosis and Fixing

VerifiedCaution

Diagnoses and fixes Go errors (compilation, runtime, lint). Analyzes error messages, identifies root causes, and applies corrections automatically.

Sby Skills Guide Bot
DevelopmentIntermediate
206/2/2026
Claude Code
#go#error-fixing#compilation-error#lint-error

Recommended for

Our review

Diagnoses and fixes Go errors including build, test, and lint errors.

Strengths

  • Automatically collects error information via go build/test/lint
  • Identifies error type and location accurately
  • Applies common fixes for compilation, runtime, and lint issues

Limitations

  • Limited to Go language errors only
  • May not handle complex logical or design errors
  • Requires the user to provide context or allow tool access
When to use it

When encountering any Go compilation, test, or lint error that needs quick diagnosis and correction.

When not to use it

When the error is vague, requires deep domain knowledge, or involves non-Go code.

Security analysis

Caution
Quality score85/100

The skill uses Bash to run standard Go development commands (go build, go test, golangci-lint). These are legitimate but execute system processes, so caution is warranted.

No concerns found

Examples

Fix build error
Fix the build error in my Go project.
Fix test failure
My Go test is failing, please fix it.
Lint error
Fix the lint errors in this Go file.

name: fix-error description: Go のエラーを診断し修正する。「エラーを直して」「ビルドエラー修正」「コンパイルエラー」「Go のエラー修正」「ビルドが通らない」「テストが失敗」「lint エラー修正」などで起動。 allowed-tools: [Read, Write, Edit, Bash, Glob, Grep] context: fork agent: shiiman-go:error-analyzer

Fix Error

Go のエラーを診断し修正するスキル。

トリガー

  • 「エラーを直して」「ビルドエラー修正」「コンパイルエラー」
  • 「Go のエラー修正」「ビルドが通らない」「テストが失敗」「lint エラー修正」

実行内容

  1. エラーメッセージの解析
  2. 原因の特定
  3. 修正の実施
  4. 修正確認

Claude への指示

実行手順

  1. エラー情報の収集

    ユーザーがエラーメッセージを提供していない場合:

    # ビルドエラー確認
    go build ./... 2>&1
    
    # テストエラー確認
    go test ./... 2>&1
    
    # lint エラー確認
    golangci-lint run ./... 2>&1
    
  2. エラー解析

    エラーメッセージから以下を特定:

    • ファイル名と行番号
    • エラータイプ(コンパイル/ランタイム/lint)
    • 具体的なエラー内容
  3. 原因特定

    # 該当ファイルを読み込み
    Read ツールで該当箇所を確認
    
    # 関連コードを検索
    Grep ツールで定義や使用箇所を検索
    
  4. 修正実施

    error-analyzer エージェントの知識を活用:

    • コンパイルエラー: 型エラー、未定義、インポート
    • ランタイムエラー: nil ポインタ、範囲外アクセス
    • lint エラー: errcheck、staticcheck、gosimple
  5. 修正確認

    go build ./...
    go test ./...
    golangci-lint run ./...
    

出力形式

## エラー修正完了

### 検出されたエラー
- 種類: {コンパイル/ランタイム/lint}
- 箇所: {ファイル名}:{行番号}
- 内容: {エラーメッセージ}

### 原因
{原因の説明}

### 修正内容
{修正した内容の説明}

### 確認結果
- ビルド: ✅ 成功
- テスト: ✅ 成功
Related skills