test: use go vet shadow feature instead of go-nyet

Use official support instead of home-made one.
This commit is contained in:
Yicheng Qin 2015-08-27 13:23:33 -07:00
parent 59a5a7e309
commit ccdb850e1e

21
test
View File

@ -74,13 +74,18 @@ if [ -n "${vetRes}" ]; then
exit 255
fi
if command -v go-nyet >/dev/null 2>&1; then
echo "Checking go-nyet..."
nyetRes=$(go-nyet -exitWith 0 $FMT)
if [ -n "${nyetRes}" ]; then
echo -e "go-nyet checking failed:\n${nyetRes}"
exit 255
fi
fi
echo "Checking govet -shadow..."
for path in $FMT; do
# only check go files under raft dir because
# auto generated file in raft/raftpb cannot pass shadow test
if [ "${path}" == "raft" ]; then
path="raft/*.go"
fi
vetRes=$(go tool vet -shadow ${path})
if [ -n "${vetRes}" ]; then
echo -e "govet checking ${path} failed:\n${vetRes}"
exit 255
fi
done
echo "Success"