Go プロジェクトのユニットテストを実行します。カバレッジ計測、特定パッケージ/ファイルのテスト、レースコンディション検出に対応。
Executes Go unit tests with coverage measurement, race detection, and targeted package/file filtering.
/plugin marketplace add shiiman/claude-code-plugins/plugin install shiiman-go@shiiman-claude-code-pluginsGo プロジェクトのユニットテストを実行します。カバレッジ計測、特定パッケージ/ファイルのテスト、レースコンディション検出に対応。
/shiiman-go:test
/shiiman-go:test ./internal/handler
/shiiman-go:test --cover
/shiiman-go:test --race
/shiiman-go:test --help
| オプション | 説明 |
|---|---|
--cover | カバレッジ計測を有効化 |
--race | データレース検出を有効化 |
--help | このコマンドのヘルプを表示 |
--help が指定された場合: このファイルの内容を要約して表示し、終了。
ls -la Taskfile.yml Makefile 2>/dev/null
検出されるタスク名の例:
test, test-unit, go-testtest:unit, unit-test# タスクランナーがある場合
task test
make test
# タスクランナーがない場合
go test ./...
# カバレッジ付き
go test -cover ./...
# カバレッジレポート生成
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
# レースコンディション検出
go test -race ./...
# 特定パッケージのテスト
go test -v ./internal/handler
# 特定テストケースのみ
go test -v -run TestCreateUser ./internal/handler
✅ テスト完了
実行パッケージ数: {N}
実行テスト数: {M}
成功: {S}
失敗: {F}
スキップ: {K}
実行時間: {T}s
カバレッジ: {C}%
失敗したテスト:
- {パッケージ/テスト名}
エラー: {エラーメッセージ}
テストコードの作成が必要な場合は、test-writer エージェントが以下をサポート:
効率的なデバッグのため、以下の順序でテストを実行:
go test -v -run TestXxx ./pathgo test -v ./internal/handlergo test ./...-race フラグ: 実行速度が遅くなるため、開発時のみ使用推奨-count=1 を使用t.Parallel() を使用して独立したテストを並行実行可能