Skip to content

Instantly share code, notes, and snippets.

@variadico
Last active April 4, 2021 02:24
Show Gist options
  • Save variadico/639ec6d7c25bdc21b3fc1a0e983601f2 to your computer and use it in GitHub Desktop.
Save variadico/639ec6d7c25bdc21b3fc1a0e983601f2 to your computer and use it in GitHub Desktop.
Install Go
#!/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