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.
More on Build Tools and Artifact Repositories
What is Maven and what is its build lifecycle?BeginnerWhat is the difference between `mvn package`, `install` and `deploy`?BeginnerHow do Maven dependency scopes and transitive dependencies work?IntermediateWhat is `settings.xml` in Maven and how do CI builds use it?IntermediateWhat is the Maven Wrapper and why use it?BeginnerHow do you cache dependencies and speed up Maven builds in CI?Intermediate