From 474cea1cd68fcfd2a7af66859b4d1c9f95b19d90 Mon Sep 17 00:00:00 2001 From: Manjunath A Kumatagi Date: Wed, 6 Feb 2019 12:12:20 -0600 Subject: [PATCH] test: Add shadow tool --- test | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test b/test index aad445ea242..10a69d70391 100755 --- a/test +++ b/test @@ -448,7 +448,11 @@ function govet_shadow_pass { fmtpkgs=$(for a in "${FMT[@]}"; do dirname "$a"; done | sort | uniq | grep -v "\\.") # shellcheck disable=SC2206 fmtpkgs=($fmtpkgs) - vetRes=$(go tool vet -all -shadow "${fmtpkgs[@]}" 2>&1 | grep -v '/gw/' || true) + # Golang 1.12 onwards the experimental -shadow option is no longer available with go vet + go get golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow + export PATH=${GOPATH}/bin:${PATH} + shadow_tool=$(which shadow) + vetRes=$(go vet -all -vettool="${shadow_tool}" "${TEST[@]}") if [ -n "${vetRes}" ]; then echo -e "govet -all -shadow checking failed:\\n${vetRes}" exit 255