Setting GOOS and GOARCH cross-compiles from any machine, which is why Go dominates devops tooling. CGO_ENABLED=0 yields a fully static binary that runs in scratch or distroless containers, keeping images tiny and attack surface low.
← Go theorytheory 0/50 · 0%
Operations · medium
37. Cross-compilation and Deployment
GOOS, GOARCH and small images.
Check your understanding
1. Which variable selects the target OS?
2. CGO_ENABLED=0 produces…