Skip to content

Commit 1524794

Browse files
committed
Fix building with GOFLAGS=-v
With go1.15 running go version with "-v" fails, and we should support it.
1 parent 529c134 commit 1524794

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hack/lib/golang.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ EOF
465465
fi
466466

467467
local go_version
468-
IFS=" " read -ra go_version <<< "$(go version)"
468+
IFS=" " read -ra go_version <<< "$(GOFLAGS='' go version)"
469469
local minimum_go_version
470470
minimum_go_version=go1.15.0
471471
if [[ "${minimum_go_version}" != $(echo -e "${minimum_go_version}\n${go_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) && "${go_version[2]}" != "devel" ]]; then
@@ -777,7 +777,7 @@ kube::golang::build_binaries() {
777777
(
778778
# Check for `go` binary and set ${GOPATH}.
779779
kube::golang::setup_env
780-
V=2 kube::log::info "Go version: $(go version)"
780+
V=2 kube::log::info "Go version: $(GOFLAGS='' go version)"
781781

782782
local host_platform
783783
host_platform=$(kube::golang::host_platform)

0 commit comments

Comments
 (0)