Skip to content

Instantly share code, notes, and snippets.

@goodjob1114
Last active January 28, 2016 08:58
Show Gist options
  • Save goodjob1114/f91f42361fd13ce42f8c to your computer and use it in GitHub Desktop.
Save goodjob1114/f91f42361fd13ce42f8c to your computer and use it in GitHub Desktop.
install-golang-by-gvm
#!/bin/bash
case ${OSTYPE} in
linux-gnu)
r=$(lsb_release -si)
if [ $r == "Ubuntu" ] || [ $r == "Debian" ]; then
sudo apt-get install -y binutils bison gcc make git
else
echo "Not Ubuntu..."
fi
;;
darwin*)
echo "Hello MacOS"
;;
*) echo Unknown;;
esac
compiler="go1.4"
stable="go1.5.3"
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer); \
source ~/.gvm/scripts/gvm && \
gvm install $compiler && \
gvm use $compiler && \
gvm install $stable && \
gvm use $stable --default
echo ''
echo 'Please restart your terminal session or to get started right away run'
echo '`source ~/.gvm/scripts/gvm`'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment