2020-03-23 15:28:54 +00:00
|
|
|
parameters:
|
|
|
|
target_directory:
|
|
|
|
type: string
|
|
|
|
default: /usr/local
|
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: install golang
|
|
|
|
command: |
|
|
|
|
set -x
|
2020-03-23 15:28:54 +00:00
|
|
|
|
|
|
|
os="linux"
|
|
|
|
if [[ "$OSTYPE" == "darwin"* ]]
|
|
|
|
then
|
|
|
|
os="darwin"
|
|
|
|
fi
|
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
echo installing golang ${GOLANG_VERSION}
|
2020-03-23 15:28:54 +00:00
|
|
|
sudo rm -rf << parameters.target_directory >>/go
|
|
|
|
sudo mkdir -p << parameters.target_directory >>
|
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
|
|
|
sudo tar -C << parameters.target_directory >> -xzf /tmp/golang.tar.gz
|
2019-11-20 16:11:28 +00:00
|
|
|
rm -rf /tmp/golang.tar.gz
|