Last active
July 17, 2020 22:48
-
-
Save kudarap/cd8899c5473149cedd6318890ac71fcc to your computer and use it in GitHub Desktop.
bash script for updating golang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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