Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Cross-compiling Go on
sudo chown $USER /usr/local/go
rm -rf /usr/local/go/*
curl -L | tar -C /usr/local -xzf -
# Install dependencies...
go get
godep restore
# Compile normally; this catches errors before cross-compiling.
go install ./...
# Cross-compile.
go get
gox --osarch="$GOX_OSARCH" --build-toolchain
gox --osarch="$GOX_OSARCH" --output="dist/{{.OS}}_{{.Arch}}/{{.Dir}}" ./...
GOX_OSARCH="darwin/amd64 linux/amd64 windows/amd64 linux/arm"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment