Skip to content

Instantly share code, notes, and snippets.

@ejfinneran
Created September 1, 2015 03:08
Show Gist options
  • Save ejfinneran/34d02cb229e240833e11 to your computer and use it in GitHub Desktop.
Save ejfinneran/34d02cb229e240833e11 to your computer and use it in GitHub Desktop.
Golang Installer
#/bin/sh
platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
elif [[ "$unamestr" == 'Darwin' ]]; then
platform='darwin'
fi
url=''
filename=''
if [[ "$platform" == 'linux' ]]; then
url='https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gz'
filename='go1.5.linux-amd64.tar.gz'
fi
cd /tmp
wget $url
sudo tar -C /usr/local -zxf $filename
echo 'PATH=$PATH:/usr/local/go/bin' >> ~/.profile
echo "`go version` installed!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment