Last active
August 29, 2015 14:07
-
-
Save orian/5707bed72956ace827b5 to your computer and use it in GitHub Desktop.
Go install script
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 | |
# 1. Save file as go_install.sh | |
# 2. chmod +x go_install.sh | |
# 3. ./go_install.sh | |
# 4. Profit. | |
# Get Go package | |
PKGNAME=go1.3.3.linux-amd64.tar.gz | |
rm -f $PKGNAME | |
wget https://storage.googleapis.com/golang/$PKGNAME | |
# set install dir (one of below must not be commented) | |
#GOINSTALLDIR=/usr/local | |
GOINSTALLDIR=$HOME/Downloads/software | |
echo "Will install in: $GOINSTALLDIR" | |
# extract | |
sudo tar -C $GOINSTALLDIR -xzf go1.3.3.linux-amd64.tar.gz | |
# set for this session | |
export GOROOT=$GOINSTALLDIR/go | |
export PATH=$PATH:$GOROOT/bin | |
# set for future sessions | |
echo "Setting GOROOT and PATH." | |
echo "export GOROOT=$GOROOT" >> $HOME/.bashrc | |
echo "export PATH=\$PATH:$GOROOT/bin" >> $HOME/.bashrc | |
echo "Success." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment