Skip to content

Instantly share code, notes, and snippets.

@klingtnet
Created November 3, 2019 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klingtnet/4914a2c13ea637eacff954907ef25ec3 to your computer and use it in GitHub Desktop.
Save klingtnet/4914a2c13ea637eacff954907ef25ec3 to your computer and use it in GitHub Desktop.
Go installation script for Linux
#!/bin/bash
set -eo pipefail
_version=${1:-'1.13.4'}
set -u
rm -rf /usr/local/go
curl -Lsf "https://dl.google.com/go/go${_version}.linux-amd64.tar.gz" | tar -C/usr/local -xvzf-
cat <<HEREDOC>/etc/profile.d/go.sh
export PATH=$PATH:/usr/local/go/bin
HEREDOC
echo "Source /etc/login or restart"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment