Skip to content

Instantly share code, notes, and snippets.

@jasonwbarnett
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonwbarnett/8f7422c2662b07dd3316 to your computer and use it in GitHub Desktop.
Save jasonwbarnett/8f7422c2662b07dd3316 to your computer and use it in GitHub Desktop.
How to install Go in a few seconds
#!/bin/bash
wget "http://golang.org/dl/go1.3.linux-amd64.tar.gz" -O ~/go1.3.linux-amd64.tar.gz
tar -C /usr/local -xzf ~/go1.3.linux-amd64.tar.gz
cat << 'EOF' | sudo tee -a /etc/profile
export GOROOT=/usr/local/go
export PATH=$PATH:/usr/local/go/bin
EOF
mkdir ~/go/{,pkg,src,bin}
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment