From c538c3115071d6d806ab3f4098838590ff6d9a8f Mon Sep 17 00:00:00 2001 From: Arjan Singh Bal <46515553+arjan-bal@users.noreply.github.com> Date: Tue, 22 Oct 2024 22:34:38 +0530 Subject: [PATCH] vet: Don't use GOROOT to set PATH if GOROOT is unset (#7761) --- scripts/vet.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/vet.sh b/scripts/vet.sh index aba59a5995bc..1d9991a55834 100755 --- a/scripts/vet.sh +++ b/scripts/vet.sh @@ -21,7 +21,10 @@ cleanup() { } trap cleanup EXIT -PATH="${HOME}/go/bin:${GOROOT}/bin:${PATH}" +if [ -n "${GOROOT}" ]; then + PATH="${GOROOT}/bin:${PATH}" +fi +PATH="${HOME}/go/bin:${PATH}" go version if [[ "$1" = "-install" ]]; then