Cross-compile for Linux amd64.
Section: Cross Compilation
Build Linux amd64
bash
bash
GOOS=linux GOARCH=amd64 go build -o dist/app-linux-amd64 .Explanation
Cross-compile for Linux amd64. 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