Last active
September 5, 2016 11:24
-
-
Save thisconnect/984634718308a54e97b90602584cc1af to your computer and use it in GitHub Desktop.
compile go from source
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
#!/bin/bash | |
mkdir -p ~/go | |
cd ~/go | |
# first install go1.4 | |
git clone --branch go1.4.3 --depth 1 https://go.googlesource.com/go go1.4 | |
cd go1.4/src | |
./make.bash | |
../bin/go version | |
cd ../../ | |
export GOROOT_BOOTSTRAP=$HOME/go/go1.4 | |
git clone --branch go1.6.3 --depth 1 https://go.googlesource.com/go latest | |
cd latest/src | |
./make.bash | |
cd ../../ | |
export PATH=$PATH:~/go/latest/bin | |
go version | |
mkdir -p packages | |
# now add this to .profile or .bash_profile | |
# export GOROOT=~/go/latest | |
# export GOPATH=~/go/packages | |
# export PATH=$PATH:$GOROOT/bin | |
# export PATH=$PATH:$GOPATH/bin | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment