Interview Prep/CI/CD/Build Tools and Artifact Repositories

What is Go's build flow in CI and how does module caching work?

IntermediateConceptBuild Tools and Artifact Repositories
Answer

go mod download fetches modules into GOMODCACHE (~/go/pkg/mod), verified against go.sum. go build caches compiled packages in GOCACHE. Cache both keyed on go.sum. Static binaries for containers: CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o app ./cmd/app, then copy into a distroless or scratch image.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Build Tools and Artifact Repositories