/go-build Command
This command invokes the go-build-resolver agent to incrementally fix Go build errors with minimal changes.What This Command Does
- Run Diagnostics: Execute
go build,go vet,staticcheck - Parse Errors: Group by file and sort by severity
- Fix Incrementally: One error at a time
- Verify Each Fix: Re-run build after each change
- Report Summary: Show what was fixed and what remains
When to Use
Use/go-build when:
go build ./...fails with errorsgo vet ./...reports issuesgolangci-lint runshows warnings- Module dependencies are broken
- After pulling changes that break the build
Diagnostic Commands Run
Command Syntax
Common Errors Fixed
| Error | Typical Fix |
|---|---|
undefined: X | Add import or fix typo |
cannot use X as Y | Type conversion or fix assignment |
missing return | Add return statement |
X does not implement Y | Add missing method |
import cycle | Restructure packages |
declared but not used | Remove or use variable |
cannot find package | go get or go mod tidy |
Stop Conditions
The agent will stop and report if:- Same error persists after 3 attempts
- Fix introduces more errors
- Requires architectural changes
- Missing external dependencies
Related
- Agent:
agents/go-build-resolver.md - Skill:
skills/golang-patterns/ - Commands:
/go-test,/go-review,/verify