travis: make import of math/rand fail build
MODIFY
.travis.yml
.travis.yml
@@ -36,6 +36,7 @@ script:
- go test -a -tags noasm -v ./...
- go test -a -tags appengine -v ./...
- if [[ $TRAVIS_SECURE_ENV_VARS = "true" ]]; then bash ./.travis/test-coverage.sh; fi
+ - ${TRAVIS_BUILD_DIR}/.travis/check-rand.sh
# This is run last since it alters the tree.
- ${TRAVIS_BUILD_DIR}/.travis/check-generate.sh

ADD
.travis/check-rand.sh
+#!/bin/bash
+
+RAND_IMPORTERS=$(find -name "*.go" -printf '%P\n' | xargs grep -l '"math/rand"')
+if [[ -n "$RAND_IMPORTERS" ]]; then
+ echo -e '\e[31mImports of "math/rand" in:\n'
+ for F in $RAND_IMPORTERS; do
+ echo $F
+ done
+ echo -e '\e[0'
+ exit 1
+fi

travis: make import of math/rand fail build