Skip to content

Instantly share code, notes, and snippets.

@Gabelbombe
Last active June 17, 2019 19:57
Show Gist options
  • Save Gabelbombe/ad92bc78e24c6696da04fa8380bbcd81 to your computer and use it in GitHub Desktop.
Save Gabelbombe/ad92bc78e24c6696da04fa8380bbcd81 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash -xe
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