Skip to content

Instantly share code, notes, and snippets.

@swdream
Created November 13, 2018 07:08
Show Gist options
  • Save swdream/37fdfe1f3b87a91aa217b267504af180 to your computer and use it in GitHub Desktop.
Save swdream/37fdfe1f3b87a91aa217b267504af180 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -ex

cd /tmp
curl -O https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
tar xvf go1.10.3.linux-amd64.tar.gz

mkdir ~/go

sudo chown -R root:root ~/go

sudo mv go /usr/local

mkdir $HOME/work

touch ~/.profile

echo "export GOPATH=$HOME/work" >> ~/.profile
echo "export PATH=$PATH:/usr/local/go/bin:$GOROOT/bin:$GOPATH/bin" >> ~/.profile
echo "export GOROOT=$HOME/go" >> ~/.profile

source ~/.profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment