Go - Modules & Dependency Mgmt

Beginner 10/10 Teacher 10/10 Architect 10/10

Modules

go mod init example.com/app
go get github.com/google/[email protected]
go mod tidy

Versioning

  • Semantic import versioning for v2+ modules (e.g., module/v2).
  • Pin versions explicitly to ensure reproducible builds.

Tooling

  • go fmt ./... format
  • go vet ./... static checks
  • golangci-lint (external) for aggregate linting

Reproducibility

  • Use go env -w GOPROXY=https://proxy.golang.org,direct when needed.
  • Consider vendor/ with go mod vendor for locked environments.