Skip to content

Instantly share code, notes, and snippets.

@kudarap
Last active July 17, 2020 22:48
Show Gist options
  • Save kudarap/cd8899c5473149cedd6318890ac71fcc to your computer and use it in GitHub Desktop.
Save kudarap/cd8899c5473149cedd6318890ac71fcc to your computer and use it in GitHub Desktop.
bash script for updating golang
#!/bin/sh
ver=$1
if [ -z "$ver" ]
then
echo go version required
exit
fi
echo Downloading go version $ver...
wget https://dl.google.com/go/go$ver.linux-amd64.tar.gz
echo Installing go version $ver...
sudo tar -C /usr/local -xzf go$ver.linux-amd64.tar.gz
echo Cleaning up...
rm go$ver.linux-amd64.tar.gz
echo Updated to `go version`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment