Created
August 25, 2017 04:41
-
-
Save WindomZ/e317706cdbd907634646733b79d55971 to your computer and use it in GitHub Desktop.
golang cross compile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# linux 64bit | |
$ GOOS=linux GOARCH=amd64 go build | |
# with the -o option to specify the name of the generated binary file | |
$ GOOS=linux GOARCH=amd64 go build -o app.linux | |
# linux 32bit | |
$ GOOS=linux GOARCH=386 go build | |
# windows 64bit | |
$ GOOS=windows GOARCH=amd64 go build | |
# windows 32bit | |
$ GOOS=windows GOARCH=386 go build | |
# Mac OS X 64bit | |
$ GOOS=darwin GOARCH=amd64 go build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment