Skip to content

Commit 15df3d6

Browse files
committed
Make verify-typecheck not depend on GOPATH
This script fails if not under a GOPATH because we use go/types, which is not modules aware.
1 parent a2f2607 commit 15df3d6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

hack/verify-typecheck.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ cd "${KUBE_ROOT}"
3030

3131
make --no-print-directory -C "${KUBE_ROOT}" generated_files
3232

33+
# As of June, 2020 the typecheck tool is written in terms of go/types, but that
34+
# library doesn't work well with modules. Guidance is to rewrite tools against
35+
# golang.org/x/tools/go/packages. Until that is done, force this tooling to
36+
# run in a fake GOPATH.
3337
ret=0
34-
go run test/typecheck/main.go "$@" || ret=$?
38+
hack/run-in-gopath.sh \
39+
go run test/typecheck/main.go "$@" || ret=$?
3540
if [[ $ret -ne 0 ]]; then
3641
echo "!!! Type Check has failed. This may cause cross platform build failures." >&2
3742
echo "!!! Please see https://git.k8s.io/kubernetes/test/typecheck for more information." >&2

0 commit comments

Comments
 (0)