Last active
April 4, 2021 02:24
-
-
Save variadico/639ec6d7c25bdc21b3fc1a0e983601f2 to your computer and use it in GitHub Desktop.
Install Go
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
#!/usr/bin/env bash | |
set -euo pipefail | |
version=${1:-} | |
if [[ -z "$version" ]]; then | |
echo "missing version" | |
echo "usage: install-go.sh <version>" | |
exit 1 | |
fi | |
dl="/tmp/go.tar.gz" | |
url="https://dl.google.com/go/go${version}.linux-amd64.tar.gz" | |
set -x | |
curl -L -o "$dl" "$url" | |
sudo rm -rf /usr/local/go | |
sudo tar -C /usr/local -xzf "$dl" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment