diff --git a/hack/verify-typecheck.sh b/hack/verify-typecheck.sh index cc078d3fb15..ebdc4c06853 100755 --- a/hack/verify-typecheck.sh +++ b/hack/verify-typecheck.sh @@ -30,8 +30,13 @@ cd "${KUBE_ROOT}" make --no-print-directory -C "${KUBE_ROOT}" generated_files +# As of June, 2020 the typecheck tool is written in terms of go/types, but that +# library doesn't work well with modules. Guidance is to rewrite tools against +# golang.org/x/tools/go/packages. Until that is done, force this tooling to +# run in a fake GOPATH. ret=0 -go run test/typecheck/main.go "$@" || ret=$? +hack/run-in-gopath.sh \ + go run test/typecheck/main.go "$@" || ret=$? if [[ $ret -ne 0 ]]; then echo "!!! Type Check has failed. This may cause cross platform build failures." >&2 echo "!!! Please see https://git.k8s.io/kubernetes/test/typecheck for more information." >&2