github.com/zhouxv/fabric@v2.1.1+incompatible/vagrant/golang.sh (about) 1 #!/bin/bash -eu 2 # 3 # Copyright IBM Corp. All Rights Reserved. 4 # 5 # SPDX-License-Identifier: Apache-2.0 6 7 GOROOT='/opt/go' 8 GO_VERSION=1.14.1 9 10 # ---------------------------------------------------------------- 11 # Install Golang 12 # ---------------------------------------------------------------- 13 GO_URL=https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz 14 mkdir -p $GOROOT 15 curl -sL "$GO_URL" | (cd $GOROOT && tar --strip-components 1 -xz) 16 17 # ---------------------------------------------------------------- 18 # Setup environment 19 # ---------------------------------------------------------------- 20 cat <<EOF >/etc/profile.d/goroot.sh 21 export GOROOT=$GOROOT 22 export PATH=\$PATH:$GOROOT/bin 23 EOF