Skip to content

Instantly share code, notes, and snippets.

@thisconnect
Last active September 5, 2016 11:24
Show Gist options
  • Save thisconnect/984634718308a54e97b90602584cc1af to your computer and use it in GitHub Desktop.
Save thisconnect/984634718308a54e97b90602584cc1af to your computer and use it in GitHub Desktop.
compile go from source
#!/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