Last active
December 27, 2015 04:59
-
-
Save rdallman/7271130 to your computer and use it in GitHub Desktop.
Installs go, gets go.tools, gets go-doctor (for internal use)
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 | |
# | |
# run with ./goinstall.bash USERNAME=yourusernamehere | |
# e.g. ./goinstall.bash USERNAME=rpa0003 | |
# Install latest Go from source | |
# Setup GOROOT and GOPATH | |
# Install go.tools | |
# get go from source | |
sudo apt-get install mercurial | |
hg clone -u release https://code.google.com/p/go $HOME/go | |
cd $HOME/go | |
# update to tip | |
hg update default | |
cd src | |
# compile | |
./all.bash | |
# for go projects | |
mkdir $HOME/gocode | |
# add env variables to path | |
echo GOPATH=$HOME/gocode >> ~/.bashrc | |
echo GOROOT=$HOME/go >> ~/.bashrc | |
echo PATH=$GOPATH/bin:$GOROOT/bin:$PATH >> ~/.bashrc | |
# update | |
source ~/.bashrc | |
# get go.tools for importer/oracle/etc. | |
go get code.google.com/p/go.tools | |
# get go-doctor | |
cd $GOPATH/src | |
sudo apt-get install git | |
git clone ssh://$USERNAME@git.openrefactory.org/gitroot/go-doctor.git | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment