Created
September 25, 2019 08:31
-
-
Save forelabs/daa24411ecada3a80480db22c7cf9530 to your computer and use it in GitHub Desktop.
go version update
This file contains 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
function update-go() { | |
release=$(curl --silent https://golang.org/doc/devel/release.html | grep -Eo 'go[0-9]+(\.[0-9]+)+' | sort -V | uniq | tail -1) | |
os=$(uname -s | tr '[:upper:]' '[:lower:]') | |
arch=$(case "$(uname -m)" in i*) echo '386' ;; x*) echo 'amd64' ;; *) echo 'armv61'; esac) | |
curl --silent https://storage.googleapis.com/golang/$release.$os-$arch.tar.gz \ | |
| sudo tar -vxz --strip-components 1 -C $(dirname $(dirname $(which go))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment