2019-03-01 10:48:04 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-08-26 13:06:05 +00:00
|
|
|
curl -O https://dl.google.com/go/go"${GO_VERSION}".linux-amd64.tar.gz
|
2019-03-01 10:48:04 +00:00
|
|
|
|
2019-08-26 13:06:05 +00:00
|
|
|
tar -xvf go"${GO_VERSION}".linux-amd64.tar.gz
|
|
|
|
rm -rf go"${GO_VERSION}".linux-amd64.tar.gz
|
2019-03-01 10:48:04 +00:00
|
|
|
|
2019-08-26 13:06:05 +00:00
|
|
|
sudo mkdir -p /usr/local/golang/"${GO_VERSION}"/go
|
|
|
|
sudo mv go /usr/local/golang/"${GO_VERSION}"/
|
2019-03-01 10:48:04 +00:00
|
|
|
|
|
|
|
sudo rm /usr/local/bin/go
|
2019-08-26 13:06:05 +00:00
|
|
|
sudo chmod +x /usr/local/golang/"${GO_VERSION}"/go/bin/go
|
|
|
|
sudo ln -s /usr/local/golang/"${GO_VERSION}"/go/bin/go /usr/local/bin/go
|
2019-03-01 10:48:04 +00:00
|
|
|
|
2019-08-26 13:06:05 +00:00
|
|
|
export GOROOT="/usr/local/golang/${GO_VERSION}/go"
|
|
|
|
export GOTOOLDIR="/usr/local/golang/${GO_VERSION}/go/pkg/tool/linux_amd64"
|
2019-03-01 10:48:04 +00:00
|
|
|
|
|
|
|
go version
|