Last active
March 20, 2019 14:09
-
-
Save alexrios/f83b0ac72824ba8a053ababb8550dabe to your computer and use it in GitHub Desktop.
Update go version
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
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
very good