mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
test: speedup and strengthen go vet checking
Was iterating over every file, reloading everything. Instead, analyze the package directories. On my machine, the time for vet checking goes from 34s to 3s. Scans more code too.
This commit is contained in:
parent
cdb722123a
commit
9b33aa1967
12
test
12
test
@ -222,17 +222,13 @@ function fmt_pass {
|
|||||||
exit 255
|
exit 255
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Checking 'go tool vet -shadow'..."
|
echo "Checking 'go tool vet -all -shadow'..."
|
||||||
for path in $FMT; do
|
fmtpkgs=$(echo $FMT | xargs dirname | sort | uniq | sed '/\./d')
|
||||||
if [ "${path##*.}" != "go" ]; then
|
vetRes=$(go tool vet -all -shadow ${fmtpkgs} 2>&1 | grep -v '/gw/' || true)
|
||||||
path="${path}/*.go"
|
|
||||||
fi
|
|
||||||
vetRes=$(go tool vet -shadow ${path})
|
|
||||||
if [ -n "${vetRes}" ]; then
|
if [ -n "${vetRes}" ]; then
|
||||||
echo -e "govet -shadow checking ${path} failed:\n${vetRes}"
|
echo -e "govet -all -shadow checking failed:\n${vetRes}"
|
||||||
exit 255
|
exit 255
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
|
|
||||||
echo "Checking documentation style..."
|
echo "Checking documentation style..."
|
||||||
# eschew you
|
# eschew you
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user