Add errcheck to our bin/test script (doesn't fit well with lint)

This commit is contained in:
Tom Wilkie
2015-05-26 15:26:54 +00:00
parent 92adbf1c40
commit 924c8b84e6
2 changed files with 8 additions and 1 deletions

View File

@@ -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

View File

@@ -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