Skip to content

Instantly share code, notes, and snippets.

@figassis
Last active December 19, 2018 13:22
Show Gist options
  • Save figassis/871ad624785391b8b6fd65765ee6ed44 to your computer and use it in GitHub Desktop.
Save figassis/871ad624785391b8b6fd65765ee6ed44 to your computer and use it in GitHub Desktop.
Installer Script for Go (Linux and OSX)
#!/bin/bash
#Chekc if running on OSX or Linux
case "$OSTYPE" in
darwin*) VERSION=go1.9.2.darwin-amd64.tar.gz ;;
*) VERSION=go1.9.2.linux-amd64.tar.gz ;;
esac
wget https://redirector.gvt1.com/edgedl/go/$VERSION
tar -C /usr/local -xzf $VERSION
rm $VERSION
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.profile
echo "export GOPATH=$HOME/go" >> $HOME/.profile
source $HOME/.profile
mkdir -p $HOME/go/src
#!/bin/bash
#Chekc if running on OSX or Linux
case "$OSTYPE" in
darwin*) VERSION=go1.9.2.darwin-amd64.tar.gz ;;
*) VERSION=go1.9.2.linux-amd64.tar.gz ;;
esac
wget https://redirector.gvt1.com/edgedl/go/$VERSION
sudo tar -C /usr/local -xzf $VERSION
rm $VERSION
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.profile
echo "export GOPATH=$HOME/go" >> $HOME/.profile
source $HOME/.profile
mkdir -p $HOME/go/src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment