Skip to content

Instantly share code, notes, and snippets.

@yonderbread
Last active March 25, 2021 21:35
Show Gist options
  • Save yonderbread/388bb02b57336c0256b620bb939ffc3e to your computer and use it in GitHub Desktop.
Save yonderbread/388bb02b57336c0256b620bb939ffc3e to your computer and use it in GitHub Desktop.
export VERSION="1.15.5" # Change to desired version
export ARCH="amd64"
export FILENAME="go${VERSION}.linux-${ARCH}.tar.gz"
curl -O -L "https://golang.org/dl/${FILENAME}"
tar -xf "${FILENAME}"
sudo chown -R root:root ./go
sudo mv -v go /usr/local
rm -rf $FILENAME
if [ ! -d $HOME/go ]; then
mkdir -p $HOME/go
fi
echo "export GOPATH=$HOME/go" >> ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin" >> ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment