diff --git a/.golangci.yml b/.golangci.yml index c518256d4b..655c4b7fb3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ run: timeout: 10m - go: "1.21" + go: "1.22" skip-files: - "zz_generated.*\\.go$" - "_conversion\\.go$" diff --git a/Makefile b/Makefile index 9ca8b7cf6f..6ca3955560 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ SHELL:=/usr/bin/env bash # # Go. # -GO_VERSION ?= 1.21.11 +GO_VERSION ?= 1.22.4 GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION) # Use GOPROXY environment variable if set diff --git a/hack/ensure-go.sh b/hack/ensure-go.sh index f9c2152de3..b5cbed218d 100755 --- a/hack/ensure-go.sh +++ b/hack/ensure-go.sh @@ -18,14 +18,16 @@ set -o errexit set -o nounset set -o pipefail -# MIN_GO_VERSION is the minimum, supported Go version. -# Note: Enforce only the minor version as we can't guarantee that -# the images we use in ProwJobs already use the latest patch version. -MIN_GO_VERSION="go${MIN_GO_VERSION:-1.21}" +if [[ "${TRACE-0}" == "1" ]]; then + set -o xtrace +fi + +# shellcheck source=./hack/utils.sh +source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" # Ensure the go tool exists and is a viable version. verify_go_version() { - if ! command -v go >/dev/null 2>&1; then + if [[ -z "$(command -v go)" ]]; then cat <