1#!/bin/bash
2set -e
3
4if [[ $GO111MODULE == "on" ]]; then
5  go get .
6else
7  go get -u -v $(go list -f '{{join .Imports "\n"}}{{"\n"}}{{join .TestImports "\n"}}' ./... | sort | uniq | grep -v appengine)
8fi
9
10if [[ $GOAPP == "true" ]]; then
11  mkdir /tmp/sdk
12  curl -o /tmp/sdk.zip "https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.68.zip"
13  unzip -q /tmp/sdk.zip -d /tmp/sdk
14  # NOTE: Set the following env vars in the test script:
15  # export PATH="$PATH:/tmp/sdk/go_appengine"
16  # export APPENGINE_DEV_APPSERVER=/tmp/sdk/go_appengine/dev_appserver.py
17fi
18
19