Skip to content

Commit

Permalink
test: Add shadow tool
Browse files Browse the repository at this point in the history
  • Loading branch information
mkumatag committed Feb 7, 2019
1 parent 1fe6f10 commit 474cea1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 474cea1

Please sign in to comment.