github.com/tardisgo/tardisgo@v0.0.0-20161119180838-e0dd9a7e46b5/goinstall.sh (about) 1 # extract from: https://gist.github.com/einthusan/f72c6dc7e0eff88b8bfe 2 3 echo "Remove existing go installation" 4 sudo apt-get purge golang -y 5 echo "Download and install Go, as well as create GOPATH directory" 6 cd ~ 7 wget https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz 8 tar -xf go1.5.2.linux-amd64.tar.gz && rm go1.5.2.linux-amd64.tar.gz 9 sudo mv go /usr/local && sudo mkdir -p ~/gopath 10 echo "set enviornment variables required for Go" 11 export GOPATH=~/gopath 12 cat <<EOF >> ~/.bashrc 13 export GOPATH=~/gopath 14 export GOROOT=/usr/local/go 15 export GOTOOLDIR=/usr/local/go/pkg/tool/linux_amd64 16 export PATH=$GOPATH/bin:/usr/local/go/bin:$PATH 17 export GORACE=log_path=/usr/local/go/racereport 18 export w=$GOPATH/src/github.com 19 EOF