Skip to content

Commit 5df49f9

Browse files
Claudesreya
Claude
authored andcommitted
feat: update Go version to 1.24.1
- Update go.mod to use Go 1.24.1 - Fix cryptorand package tests for Go 1.24.1 compatibility - Update GitHub Actions setup-go action to use Go 1.24.1 - Update Nix build config to use Go 1.24 modules 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e8d5f98 commit 5df49f9

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

.github/actions/setup-go/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: |
44
inputs:
55
version:
66
description: "The Go version to use."
7-
default: "1.22.12"
7+
default: "1.24.1"
88
runs:
99
using: "composite"
1010
steps:

cryptorand/errors_go123_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build !go1.24
1+
//go:build !go1.24 && !go1.25
22

33
package cryptorand_test
44

cryptorand/errors_go124_test.go

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//go:build go1.24
2+
3+
package cryptorand_test
4+
5+
import (
6+
"testing"
7+
8+
"github.com/coder/coder/v2/cryptorand"
9+
)
10+
11+
// TestRandError_Go1_24 verifies that cryptorand functions don't panic in Go 1.24+
12+
// In Go 1.24+ we can't replace the rand.Reader to test error cases, but we can at
13+
// least verify the functions don't panic.
14+
func TestRandError_Go1_24(t *testing.T) {
15+
t.Run("StringCharset", func(t *testing.T) {
16+
_, err := cryptorand.HexString(10)
17+
if err != nil {
18+
t.Errorf("Unexpected error: %v", err)
19+
}
20+
})
21+
}

flake.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
gnused
131131
gnugrep
132132
gnutar
133-
go_1_22
133+
go_1_24
134134
go-migrate
135135
(pinnedPkgs.golangci-lint)
136136
gopls
@@ -196,7 +196,7 @@
196196
# slim bundle into it's own derivation.
197197
buildFat =
198198
osArch:
199-
pkgs.buildGo122Module {
199+
pkgs.buildGo124Module {
200200
name = "coder-${osArch}";
201201
# Updated with ./scripts/update-flake.sh`.
202202
# This should be updated whenever go.mod changes!

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/coder/coder/v2
22

3-
go 1.22.12
3+
go 1.24.1
44

55
// Required until a v3 of chroma is created to lazily initialize all XML files.
66
// None of our dependencies seem to use the registries anyways, so this

0 commit comments

Comments
 (0)