Created
October 18, 2020 13:58
-
-
Save minzak/7867a4d392526da9b85ec5290a973c3e to your computer and use it in GitHub Desktop.
Fing latest go version and install it.
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
echo "Getting latest Go version." | |
goarch="$(wget -qO- https://golang.org/dl/ | grep -oP 'go([0-9\.]+)\.linux-amd64\.tar\.gz' | head -n 1 )" | |
echo "Downloading latest Go for AMD64: ${goarch}" | |
wget --quiet --continue --show-progress "https://golang.org/dl/${goarch}" | |
sudo rm -rf /usr/local/go | |
sudo tar -C /usr/local -xzf $goarch | |
rm $goarch | |
unset goarch | |
go version | |
#if [ -d "/usr/local/go" ] ; then | |
# export GOROOT=/usr/local/go | |
# export GOPATH=/usr/src/go | |
# export PATH=$PATH:$GOROOT/bin | |
# export CGO_ENABLE=0 | |
# #export $GOOS=linux | |
# #export $GOARCH=amd64 | |
# else | |
#export PATH | |
#fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment