-
-
Save BuddhiLW/bdeba502cf6d613051dd428e00edcbcf to your computer and use it in GitHub Desktop.
Install go programatically
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
#!/usr/bin/bash | |
GO_FILE=$(wget -O - https://go.dev/dl/ 2>/dev/null | sed -ne 's@.*\(\/go1\.[0-9]*\.[0-9]*\.linux-amd64\.tar\.gz\).*@\1@p' 2>&1 | head -n 1| tr -d /) | |
URL_DOWNLOAD="https://go.dev/dl/$GO_FILE" | |
echo "URL_DOWNLOAD=$URL_DOWNLOAD" | |
wget "$URL_DOWNLOAD" | |
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf $GO_FILE | |
echo "Deleating $GO_FILE (Cleaning)" | |
rm $GO_FILE | |
echo 'export PATH=$PATH:/usr/local/go/bin' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment