mirror of
https://github.com/kubernetes-sigs/kind.git
synced 2025-11-30 23:16:04 +07:00
Merge pull request #4038 from BenTheElder/go-setup
make setup-go.sh GOTOOLCHAIN aware
This commit is contained in:
@@ -29,12 +29,18 @@ export GIMME_ENV_PREFIX=./bin/.gimme/
|
|||||||
export GIMME_SILENT_ENV=y
|
export GIMME_SILENT_ENV=y
|
||||||
|
|
||||||
# only setup go if we haven't set FORCE_HOST_GO, or `go version` doesn't match
|
# only setup go if we haven't set FORCE_HOST_GO, or `go version` doesn't match
|
||||||
# go version output looks like:
|
if [ -n "${FORCE_HOST_GO:-}" ]; then
|
||||||
# go version go1.14.5 darwin/amd64
|
GOTOOLCHAIN="${GOTOOLCHAIN:-local}"
|
||||||
if ! ([ -n "${FORCE_HOST_GO:-}" ] || \
|
export GOTOOLCHAIN
|
||||||
(command -v go >/dev/null && [ "$(go version | cut -d' ' -f3)" = "go${GO_VERSION}" ])); then
|
else
|
||||||
|
GOTOOLCHAIN="go${GO_VERSION}"
|
||||||
|
export GOTOOLCHAIN
|
||||||
|
# go version output looks like:
|
||||||
|
# go version go1.14.5 darwin/amd64
|
||||||
|
if ! (command -v go >/dev/null && [ "$(go version | cut -d' ' -f3)" = "go${GO_VERSION}" ]); then
|
||||||
# eval because the output of this is shell to set PATH etc.
|
# eval because the output of this is shell to set PATH etc.
|
||||||
eval "$(hack/third_party/gimme/gimme "${GO_VERSION}")"
|
eval "$(hack/third_party/gimme/gimme "${GO_VERSION}")"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# force go modules
|
# force go modules
|
||||||
|
|||||||
Reference in New Issue
Block a user