--- description: Standards for Go development, including installation paths and build preferences globs: **/*.{go,mod,sum} --- When working with Go: 1. Installation and Path: - Primary: Use Go from PATH if available - Fallback: /usr/local/go/bin/go - Always use command path resolution pattern from command-paths.mdc 2. Dependencies: - Prefer pure Go implementations over CGO when available - Examples: - Use github.com/glebarez/sqlite over gorm.io/driver/sqlite - Document any CGO dependencies in go.mod comments 3. Build Process: - Always run `go mod tidy` after dependency changes - Verify builds work without CGO: `CGO_ENABLED=0 go build` - Use build.sh for full application builds 4. Module Management: - Keep go.mod and go.sum in sync - Document version constraints - Run `go mod verify` before commits metadata: priority: high version: 1.0 examples: - input: | # Bad: Using CGO-dependent SQLite import "gorm.io/driver/sqlite" output: | # Good: Using pure Go SQLite import "github.com/glebarez/sqlite" - input: | # Bad: Direct dependency add go get some/package output: | # Good: Add dependency and tidy go get some/package go mod tidy go mod verify