Browse Source

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

Use official support instead of home-made one.
Yicheng Qin 10 years ago
parent
commit
ccdb850e1e
1 changed files with 13 additions and 8 deletions
  1. 13 8
      test

+ 13 - 8
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"