From ccdb850e1e0db7d9aa61ffbb9fc1a07076af7c24 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Thu, 27 Aug 2015 13:23:33 -0700 Subject: [PATCH] test: use go vet shadow feature instead of go-nyet Use official support instead of home-made one. --- test | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/test b/test index 981feac83..89d97cbbd 100755 --- a/test +++ b/test @@ -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"