From 1bda78be78cee0f3dba99de8e32354705066550d Mon Sep 17 00:00:00 2001 From: Ma Xinjian Date: Tue, 1 Sep 2020 16:28:32 +0800 Subject: [PATCH] fix "unbound variable" issue IGNORE is an empty array, it throws error when make verify-staticcheck $ make verify-staticcheck hack/verify-staticcheck.sh hack/verify-staticcheck.sh: line 50: IGNORE[*]: unbound variable make: *** [verify-staticcheck] Error 1 Signed-off-by: Ma Xinjian --- hack/verify-staticcheck.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/verify-staticcheck.sh b/hack/verify-staticcheck.sh index 56630f3efe..92bf3a0e51 100755 --- a/hack/verify-staticcheck.sh +++ b/hack/verify-staticcheck.sh @@ -47,7 +47,7 @@ export IFS=','; checks="${CHECKS[*]}"; unset IFS # add it to the .staticcheck_failures blacklist IGNORE=( ) -export IFS='|'; ignore_pattern="^(${IGNORE[*]})\$"; unset IFS +export IFS='|'; ignore_pattern="^(${IGNORE[*]-})\$"; unset IFS # Ensure that we find the binaries we build before anything else. export GOBIN="${KOPS_ROOT}/_output/bin" @@ -165,4 +165,4 @@ if [[ ${#gone[@]} -gt 0 ]]; then echo } >&2 exit 1 -fi \ No newline at end of file +fi