Skip to content

Commit 5b547d2

Browse files
authored
Upgrade Go to 1.24 (#2282)
* Upgrade go to 1.24.2 * remove toolchain directive no longer needed in go 1.24+ * port tools to go tools, fixes import issues * Update CONTRIBUTING.md * add TODO for moving golangci-lint to a binary install later * add gotest.tools/gotestsum to tools * remove tools.go now that it's in go.mod
1 parent db4d7f2 commit 5b547d2

File tree

6 files changed

+1149
-169
lines changed

6 files changed

+1149
-169
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
golang 1.23.2
1+
golang 1.24.2

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Common contribution types include: `doc`, `code`, `bug`, and `ideas`. See the fu
9494
## Development environment
9595

9696
You'll need the following dependencies installed to build Cog locally:
97-
- [Go](https://golang.org/doc/install): We're targeting 1.23, but you can install the latest version since Go is backwards compatible. If you're using a newer Mac with an M1 chip, be sure to download the `darwin-arm64` installer package. Alternatively you can run `brew install go` which will automatically detect and use the appropriate installer for your system architecture.
97+
- [Go](https://golang.org/doc/install): We're targeting 1.24, but you can install the latest version since Go is backwards compatible. If you're using a newer Mac with an M1 chip, be sure to download the `darwin-arm64` installer package. Alternatively you can run `brew install go` which will automatically detect and use the appropriate installer for your system architecture.
9898
- [uv](https://docs.astral.sh/uv/): Python versions and dependencies are managed by uv.
9999
- [Docker](https://docs.docker.com/desktop) or [OrbStack](https://orbstack.dev)
100100

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ BINDIR = $(PREFIX)/bin
77
INSTALL := install -m 0755
88

99
GO ?= go
10-
GORELEASER := $(GO) run github.com/goreleaser/goreleaser/[email protected]
11-
GOIMPORTS := $(GO) run golang.org/x/tools/cmd/goimports@latest
12-
GOLINT := $(GO) run github.com/golangci/golangci-lint/cmd/[email protected]
10+
GORELEASER := $(GO) tool goreleaser
11+
GOIMPORTS := $(GO) tool goimports
12+
GOLINT := $(GO) tool golangci-lint
1313

1414
UV ?= uv
1515
TOX := $(UV) run tox
@@ -67,8 +67,7 @@ clean:
6767

6868
.PHONY: test-go
6969
test-go: pkg/dockerfile/embed/.wheel
70-
$(GO) get gotest.tools/gotestsum
71-
$(GO) run gotest.tools/gotestsum -- -timeout 1200s -parallel 5 ./... $(ARGS)
70+
$(GO) tool gotestsum -- -timeout 1200s -parallel 5 ./... $(ARGS)
7271

7372
.PHONY: test-integration
7473
test-integration: $(COG_BINARIES)
@@ -83,7 +82,7 @@ test: test-go test-python test-integration
8382

8483
.PHONY: fmt
8584
fmt:
86-
$(GO) run golang.org/x/tools/cmd/goimports@latest -w -d .
85+
$(GOIMPORTS) -w -d .
8786

8887
.PHONY: generate
8988
generate:

0 commit comments

Comments
 (0)