Skip to content

Instantly share code, notes, and snippets.

@alexrios
Last active March 20, 2019 14:09
Show Gist options
  • Save alexrios/f83b0ac72824ba8a053ababb8550dabe to your computer and use it in GitHub Desktop.
Save alexrios/f83b0ac72824ba8a053ababb8550dabe to your computer and use it in GitHub Desktop.
Update go version
#!/bin/bash
SPECIFIED_VERSION=$1
DEFAULT_VERSION=1.12.1
GO_VERSION=${SPECIFIED_VERSION:-$DEFAULT_VERSION}
echo "Installing Golang version ${GO_VERSION}"
DOWNLOAD_PATH=/tmp
GO_PACKAGE=go${GO_VERSION}.linux-amd64.tar.gz
UPSTREAM=https://dl.google.com/go/$GO_PACKAGE
wget -q --show-progress $UPSTREAM -O $DOWNLOAD_PATH/$GO_PACKAGE \
&& sudo rm -rf /usr/local/go \
&& sudo tar -C /usr/local -xzf $DOWNLOAD_PATH/$GO_PACKAGE \
&& go version
@Streppel
Copy link

very good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment