From 8ec2fac8b7508e825778a1f29203e931dd0460df Mon Sep 17 00:00:00 2001 From: Jingyuan Liang Date: Wed, 6 Mar 2024 21:29:21 +0000 Subject: [PATCH] Bump Golang to 1.22 Also set GOTOOLCHAIN=local on the go command inside Makefile so it doesn't try to download a different go toolchain based on go.mod just to extract GOOS and GOARCH, if the local toolchain doesn't match go.mod. --- .github/workflows/crossbuild.yaml | 2 +- .github/workflows/tests.yaml | 2 +- .github/workflows/tools.yaml | 2 +- Makefile | 6 +++--- go.mod | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/crossbuild.yaml b/.github/workflows/crossbuild.yaml index e5f5d636..e44c25ec 100644 --- a/.github/workflows/crossbuild.yaml +++ b/.github/workflows/crossbuild.yaml @@ -6,7 +6,7 @@ jobs: crossbuild: strategy: matrix: - go-version: [ "1.20", "1.21" ] + go-version: [ "1.21", "1.22" ] platform: [ "ubuntu-latest" ] runs-on: ${{ matrix.platform }} steps: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 70a40224..428d6c00 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -6,7 +6,7 @@ jobs: test: strategy: matrix: - go-version: [ "1.20", "1.21" ] + go-version: [ "1.21", "1.22" ] platform: [ "ubuntu-latest" ] runs-on: ${{ matrix.platform }} steps: diff --git a/.github/workflows/tools.yaml b/.github/workflows/tools.yaml index 655e6132..b42f4370 100644 --- a/.github/workflows/tools.yaml +++ b/.github/workflows/tools.yaml @@ -6,7 +6,7 @@ jobs: tools: strategy: matrix: - go-version: [ "1.20", "1.21" ] + go-version: [ "1.21", "1.22" ] platform: [ "ubuntu-latest" ] runs-on: ${{ matrix.platform }} steps: diff --git a/Makefile b/Makefile index d40953e1..bb7d497b 100644 --- a/Makefile +++ b/Makefile @@ -59,12 +59,12 @@ MAKEFLAGS += --warn-undefined-variables .SUFFIXES: # Used internally. Users should pass GOOS and/or GOARCH. -OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) -ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) +OS := $(if $(GOOS),$(GOOS),$(shell GOTOOLCHAIN=local go env GOOS)) +ARCH := $(if $(GOARCH),$(GOARCH),$(shell GOTOOLCHAIN=local go env GOARCH)) TAG := $(VERSION)__$(OS)_$(ARCH) -GO_VERSION := 1.21 +GO_VERSION := 1.22 BUILD_IMAGE := golang:$(GO_VERSION)-alpine BIN_EXTENSION := diff --git a/go.mod b/go.mod index 8cda0772..705ce261 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/thockin/go-build-template -go 1.21 +go 1.22