From 65a606e2e81ee8cbd8806abfa484d2c3e01341e9 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Fri, 10 Nov 2017 17:55:55 -0800 Subject: [PATCH] test: add naked return checks Signed-off-by: Gyu-Ho Lee --- test | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test b/test index ed190b69628..cec89e6d795 100755 --- a/test +++ b/test @@ -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/*')