Add presubmit to check if there are any files that have import "testing" (#2480)

The check is done through
```
if [[ $(go list -f '{{ join .Deps " "}}') == *" testing "* ]]; then
   error..
fi
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang
2019-01-20 23:36:46 -08:00
committed by Miek Gieben
parent 725becd134
commit ef8cb40688

9
.presubmit/import-testing Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
echo "** presubmit/$(basename $0)"
# Check to make sure "testing" is not imported
if [[ $(go list -f '{{ join .Deps " "}}') == *" testing "* ]]; then
echo "** presubmit/$(basename $0): please remove any 'import \"testing\"'"
exit 1
fi