diff --git a/Makefile b/Makefile index 40700fefa5..3713a8e685 100644 --- a/Makefile +++ b/Makefile @@ -56,4 +56,5 @@ deps: github.com/golang/lint/golint \ github.com/fzipp/gocyclo \ github.com/mattn/goveralls \ - github.com/mjibson/esc + github.com/mjibson/esc \ + github.com/kisielk/errcheck diff --git a/bin/test b/bin/test index ba15396f7f..a793545c88 100755 --- a/bin/test +++ b/bin/test @@ -4,10 +4,16 @@ echo "mode: count" > profile.cov fail=0 for dir in $(find . -type f -name '*_test.go' | grep -v '^./experimental/' | xargs -n1 dirname | sort -u); do go get -t $dir + + if ! errcheck -ignore 'Close' $dir ; then + fail=1 + fi + output=$(mktemp cover.XXXXXXXXXX) if ! go test -tags netgo -covermode=count -coverprofile=$output $dir ; then fail=1 fi + if [ -f $output ]; then tail -n +2 <$output >>profile.cov rm $output