| name | using-go-tool-directive |
| description | Manages Go development tools using the Go 1.24+ tool directive in go.mod. Use when adding linters, generators, or dev tools to Go projects, running project-specific tools, integrating tools with go:generate, or migrating from tools.go patterns. |
Using Go Tool Directive
Manage project-specific development tools in Go 1.24+ using the tool directive. Ensures consistent tool versions across team members and CI/CD environments.
Use this skill when adding dev tools (linters, generators, formatters) to Go projects, running tools via go tool, integrating with go:generate, or migrating from legacy tools.go patterns.
Supporting files: COMMANDS.md for full command reference, MIGRATION.md for migration patterns, ADVANCED.md for dependency isolation and caching.
Quick Start
Add a tool to your project:
go get -tool golang.org/x/tools/cmd/stringer@latest
This adds to go.mod:
tool golang.org/x/tools/cmd/stringer
Run the tool:
go tool stringer -type=MyType
Core Workflows
Adding Tools
go get -tool github.com/golangci/golangci-lint/cmd/golangci-lint
go get -tool honnef.co/go/tools/cmd/staticcheck@v0.5.1