Skip to content

Commit

Permalink
Bump Golang to 1.22
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jingyuanliang committed Mar 6, 2024
1 parent 2af48e6 commit 8ec2fac
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/crossbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 :=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/thockin/go-build-template

go 1.21
go 1.22

0 comments on commit 8ec2fac

Please sign in to comment.