diff options
author | 2019-01-20 23:36:46 -0800 | |
---|---|---|
committer | 2019-01-21 07:36:46 +0000 | |
commit | ef8cb40688067f918d05829b1f47bb938f70d2a7 (patch) | |
tree | 148e5e9224883246d30fb0384ca3dc8a194eb881 | |
parent | 725becd134752caead1aa2b2cf3a72d01c13b599 (diff) | |
download | coredns-ef8cb40688067f918d05829b1f47bb938f70d2a7.tar.gz coredns-ef8cb40688067f918d05829b1f47bb938f70d2a7.tar.zst coredns-ef8cb40688067f918d05829b1f47bb938f70d2a7.zip |
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>
-rwxr-xr-x | .presubmit/import-testing | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/.presubmit/import-testing b/.presubmit/import-testing new file mode 100755 index 000000000..42d00bcfc --- /dev/null +++ b/.presubmit/import-testing @@ -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 |