test: add naked return checks

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
release-3.3
Gyu-Ho Lee 2017-11-10 17:55:55 -08:00
parent 0b03d22b5b
commit 65a606e2e8
1 changed files with 11 additions and 0 deletions

11
test
View File

@ -403,6 +403,17 @@ function fmt_pass {
echo "Skipping ineffassign..."
fi
if which nakedret >/dev/null; then
echo "Checking nakedret..."
nakedretResult=$(nakedret "${STATIC_ANALYSIS_PATHS[@]}" 2>&1 || true)
if [ -n "${nakedretResult}" ]; then
echo -e "nakedret checking failed:\n${nakedretResult}"
exit 255
fi
else
echo "Skipping nakedret..."
fi
echo "Checking for license header..."
licRes=""
files=$(find . -type f -iname '*.go' ! -path './cmd/*' ! -path './gopath.proto/*')