Goバックエンドのビルド・テスト・Lintワークフロー。「Goビルド」「バックエンドテスト」「golangci-lint」「go mod」「go test」「swagger」などのキーワードで自動適用。
Automates Go backend workflows including building, testing, and linting. Triggers on keywords like "go build", "backend test", or "golangci-lint" to execute commands via Makefile or go.mod detection.
/plugin marketplace add no-problem-dev/claude-code-plugins/plugin install go-backend@no-problem-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Go バックエンドプロジェクトのビルド・テスト・品質管理ワークフロー。
| コマンド | 用途 | 実行時間 |
|---|---|---|
/go-backend:go-build | バイナリビルド | 〜30秒 |
/go-backend:go-test | テスト実行 | 〜1分 |
/go-backend:go-lint | 静的解析 (golangci-lint) | 〜30秒 |
/go-backend:go-run | 開発サーバー起動 | 即時 |
/go-backend:go-tidy | 依存関係整理 | 〜10秒 |
/go-backend:go-swagger | Swagger生成 | 〜20秒 |
コード変更 → go-build(コンパイル確認)
↓ 成功
go-test(テスト実行)
↓ 全パス
go-lint(品質チェック)
↓ 問題なし
コミット・PR
このプラグインは以下の順序でプロジェクトを検出:
make test, make lint 等のターゲットがあれば使用go.mod を探索して直接 go コマンドを実行backend/, server/, api/ 等を探索| 変数 | 説明 | デフォルト |
|---|---|---|
GO_BACKEND_DIR | バックエンドディレクトリ | 自動検出 |
GO_MAIN_PATH | main.go のパス | cmd/server/main.go |
GO_BIN_NAME | 出力バイナリ名 | server |
go: modules disabled by GO111MODULE=off
対処:
export GO111MODULE=on
go mod tidy
golangci-lint: command not found
対処:
brew install golangci-lint
# または
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
swag: command not found
対処:
go install github.com/swaggo/swag/cmd/swag@latest
カバレッジ付きテストの実行:
go test -cover -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
open coverage.html
プロジェクトルートに .golangci.yml を配置することでLintルールをカスタマイズ可能。
推奨設定例:
linters:
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
linters-settings:
errcheck:
check-type-assertions: true
Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.