mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 02:34:03 +00:00
Fix last run-in-gopath user: typecheck
This now works across modules Verified by introducing errors in 2 different modules and running.
This commit is contained in:
parent
91efe7e571
commit
b32e207256
@ -23,18 +23,15 @@ set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::verify_go_version
|
||||
|
||||
cd "${KUBE_ROOT}"
|
||||
|
||||
# As of June, 2020 the typecheck tool is written in terms of go/packages, but
|
||||
# that library doesn't work well with multiple modules. Until that is done,
|
||||
# force this tooling to run in a fake GOPATH.
|
||||
kube::golang::new::setup_env
|
||||
kube::golang::verify_go_version
|
||||
|
||||
ret=0
|
||||
TYPECHECK_SERIAL="${TYPECHECK_SERIAL:-false}"
|
||||
hack/run-in-gopath.sh \
|
||||
go run test/typecheck/main.go "$@" "--serial=$TYPECHECK_SERIAL" || ret=$?
|
||||
go run ./test/typecheck "$@" "--serial=$TYPECHECK_SERIAL" || 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
|
||||
|
Loading…
Reference in New Issue
Block a user