update to go 1.16 (#281)

This commit is contained in:
Robert van Gent
2021-02-17 10:27:44 -08:00
committed by GitHub
parent 0ac845078c
commit d07cde0df9
6 changed files with 67 additions and 36 deletions

View File

@@ -31,23 +31,19 @@ set -euo pipefail
UPSTREAM_BRANCH="${TRAVIS_BRANCH:-master}"
echo "Checking for incompatible API changes relative to ${UPSTREAM_BRANCH}..."
INSTALL_DIR="$(mktemp -d)"
MASTER_CLONE_DIR="$(mktemp -d)"
PKGINFO_BRANCH=$(mktemp)
PKGINFO_MASTER=$(mktemp)
function cleanup() {
rm -rf "$INSTALL_DIR"
rm -rf "$MASTER_CLONE_DIR"
rm -f "$PKGINFO_BRANCH"
rm -f "$PKGINFO_MASTER"
}
trap cleanup EXIT
# Move to a temporary directory while installing apidiff to avoid changing
# the local .mod file.
( cd "$INSTALL_DIR" && exec go mod init unused )
( cd "$INSTALL_DIR" && exec go install golang.org/x/exp/cmd/apidiff )
# Install apidiff.
go install golang.org/x/exp/cmd/apidiff@latest
git clone -b "$UPSTREAM_BRANCH" . "$MASTER_CLONE_DIR" &> /dev/null