travis: check that we work with modules
MODIFY
.travis.yml
.travis.yml
@@ -11,6 +11,9 @@ go:
- master
env:
+ global:
+ - GO111MODULE=on
+ matrix:
- TAGS=""
- TAGS="-tags bounds"
- TAGS="-tags noasm"

MODIFY
.travis/check-generate.sh
.travis/check-generate.sh
@@ -4,8 +4,13 @@ go generate gonum.org/v1/gonum/blas
go generate gonum.org/v1/gonum/blas/gonum
go generate gonum.org/v1/gonum/unit
go generate gonum.org/v1/gonum/graph/formats/dot
+
+# Discard changes to go.mod that have been made.
+# FIXME(kortschak): Sort out a policy of what we should do with go.mod changes.
+# If we want to check changes we should set `GOFLAGS=-mod=readonly` in .travis.yml.
+git checkout -- go.mod
+
if [ -n "$(git diff)" ]; then
- git checkout -- go.mod # Discard changes to go.mod that have been made.
git diff
exit 1
fi

MODIFY
.travis/install-gocc.sh
.travis/install-gocc.sh
@@ -4,6 +4,7 @@ set -ex
# TODO(kortschak): Replace this with versioned go get when
# all our supported versions of Go support it.
+export GO111MODULE=auto
mkdir -p $GOPATH/src/github.com/goccmack
git clone https://github.com/goccmack/gocc.git $GOPATH/src/github.com/goccmack/gocc
cd $GOPATH/src/github.com/goccmack/gocc

travis: check that we work with modules