Skip to content

Commit

Permalink
Merge pull request etcd-io#7405 from heyitsanthony/fast-gosimple
Browse files Browse the repository at this point in the history
test: run unused and gosimple over all packages at once
  • Loading branch information
Anthony Romano authored Mar 2, 2017
2 parents 6092e1a + 3296c15 commit 763aef8
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions test
Original file line number Diff line number Diff line change
Expand Up @@ -224,26 +224,22 @@ function fmt_pass {

if which gosimple >/dev/null; then
echo "Checking gosimple..."
for path in $GOSIMPLE_UNUSED_PATHS; do
simplResult=`gosimple ${path} 2>&1 || true`
if [ -n "${simplResult}" ]; then
echo -e "gosimple checking ${path} failed:\n${simplResult}"
exit 255
fi
done
simplResult=`gosimple ${GOSIMPLE_UNUSED_PATHS} 2>&1 || true`
if [ -n "${simplResult}" ]; then
echo -e "gosimple checking failed:\n${simplResult}"
exit 255
fi
else
echo "Skipping gosimple..."
fi

if which unused >/dev/null; then
echo "Checking unused..."
for path in $GOSIMPLE_UNUSED_PATHS; do
unusedResult=`unused ${path} 2>&1 || true`
if [ -n "${unusedResult}" ]; then
echo -e "unused checking ${path} failed:\n${unusedResult}"
exit 255
fi
done
unusedResult=`unused ${GOSIMPLE_UNUSED_PATHS} 2>&1 || true`
if [ -n "${unusedResult}" ]; then
echo -e "unused checking failed:\n${unusedResult}"
exit 255
fi
else
echo "Skipping unused..."
fi
Expand Down

0 comments on commit 763aef8

Please sign in to comment.