Build without CGO for simpler static-ish builds.
Section: Cross Compilation
Disable CGO
bash
bash
CGO_ENABLED=0 go build .Explanation
Build without CGO for simpler static-ish builds. Useful in Go CLI workflows.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Cross Compilation