Installation¶
Prerequisites¶
- Go 1.21 or later
goimports(optional but recommended — used to sort imports in generated files)
Install via go install¶
The binary is placed in $GOPATH/bin (or $GOBIN if set). Make sure that directory is in your PATH.
Install via Homebrew (macOS and Linux)¶
Homebrew places the binary in its own prefix and adds it to PATH automatically. To upgrade later:
The tap repository is at github.com/padiazg/homebrew-go-testgen.
Build from Source¶
git clone https://github.com/padiazg/go-testgen.git
cd go-testgen
make build # outputs to bin/go-testgen
make install # installs to $GOPATH/bin
Verify Installation¶
AI Agent Skills¶
Install go-testgen AI agent skills to guide coding assistants in generating test cases:
Installs closure-check-tests and gen-test-cases skills into ~/.agents/skills/. See AI Agent Skills for usage details.
Optional: Project Configuration File¶
Create .go-testgen.yaml in your project root to control generation behavior. See Configuration for all options.