github.com/neilgarb/delve@v1.9.2-nobreaks/_scripts/test_mac.sh (about) 1 #!/bin/bash 2 3 set -x 4 set -e 5 6 GOVERSION=$1 7 ARCH=$2 8 TMPDIR=$3 9 10 if [ "$GOVERSION" = "gotip" ]; then 11 bootstrapver=$(curl https://go.dev/VERSION?m=text) 12 cd $TMPDIR 13 curl -sSL "https://storage.googleapis.com/golang/$bootstrapver.darwin-$ARCH.tar.gz" | tar -xz 14 cd - 15 if [ -x $TMPDIR/go-tip ]; then 16 cd $TMPDIR/go-tip 17 git pull origin 18 else 19 git clone https://go.googlesource.com/go $TMPDIR/go-tip 20 fi 21 export GOROOT_BOOTSTRAP=$TMPDIR/go 22 export GOROOT=$TMPDIR/go-tip 23 cd $TMPDIR/go-tip/src 24 ./make.bash 25 cd - 26 else 27 echo Finding latest patch version for $GOVERSION 28 GOVERSION=$(python _scripts/latestver.py $GOVERSION) 29 echo Go $GOVERSION on $ARCH 30 cd $TMPDIR 31 curl -sSL "https://storage.googleapis.com/golang/$GOVERSION.darwin-$ARCH.tar.gz" | tar -xz 32 cd - 33 export GOROOT="$TMPDIR/go" 34 fi 35 36 mkdir -p $TMPDIR/gopath 37 38 go env 39 40 export GOPATH="$TMPDIR/gopath" 41 export GOARCH="$ARCH" 42 export PATH="$GOROOT/bin:$PATH" 43 go version 44 45 set +e 46 make test 47 x=$? 48 if [ "$GOVERSION" = "gotip" ]; then 49 exit 0 50 else 51 exit $x 52 fi