Skip to content

Upgrade to Go 1.24#4304

Merged
StephenButtolph merged 10 commits intomasterfrom
alarso16/go-1.24
Sep 22, 2025
Merged

Upgrade to Go 1.24#4304
StephenButtolph merged 10 commits intomasterfrom
alarso16/go-1.24

Conversation

@alarso16
Copy link
Copy Markdown
Contributor

@alarso16 alarso16 commented Sep 19, 2025

Why this should be merged

Go 1.25 has come out, so it's time to upgrade to go 1.24! Here's the release differences if you want to look: https://tip.golang.org/doc/go1.24.

Specifically, rand.Seed doesn't actually set the seed anymore, so I masked rand with the seeded source when necessary.

The following features will be supported, so this is blocking these items:

  • CGO improvements in Firewood
  • Using runtime.AddCleanup for Firewood proposals

Although golangci-lint v2.1.6 isn't built with 1.24, it is supported, so no change is necessary (but it should likely be updated to a newer version eventually).

How this works

Upgrades go.mod and ran go mod tidy

How this was tested

CI

Need to be documented in RELEASES.md?

No

@alarso16 alarso16 self-assigned this Sep 19, 2025
@alarso16 alarso16 moved this to In Progress 🏗️ in avalanchego Sep 19, 2025
@alarso16 alarso16 marked this pull request as ready for review September 19, 2025 19:53
Copilot AI review requested due to automatic review settings September 19, 2025 19:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the project from Go 1.23.9 to Go 1.24.7 to prepare for upcoming features and align with the latest Go release cycle. The changes address Go 1.24's deprecation of rand.Seed() by replacing global seeding with local seeded random sources.

  • Upgrades Go version and dependencies in go.mod
  • Replaces deprecated rand.Seed() calls with rand.New(rand.NewSource()) pattern
  • Updates generated code files to reflect new canoto version

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
go.mod Upgrades Go version from 1.23.9 to 1.24.7 and updates various dependencies
utils/bag/bag_benchmark_test.go Removes global rand.Seed init and adds local seeded sources to benchmarks
tests/e2e/x/transfer/virtuous.go Removes deprecated rand.Seed call
network/tracked_ip.go Removes global rand.Seed init function
ids/bits_test.go Replaces rand.Seed with local seeded source
chains/atomic/atomictest/shared_memory.go Replaces rand.Seed calls with local seeded sources
Multiple .canoto.go files Updates generated code version from v0.17.1 to v0.17.2

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread tests/e2e/x/transfer/virtuous.go
@joshua-kim joshua-kim changed the title chore: upgrade to Go 1.24 Upgrade to Go 1.24 Sep 19, 2025
Comment thread tests/e2e/x/transfer/virtuous.go
joshua-kim
joshua-kim previously approved these changes Sep 19, 2025
@alarso16 alarso16 moved this from In Progress 🏗️ to In Review 🔎 in avalanchego Sep 19, 2025
Copy link
Copy Markdown
Contributor

@joshua-kim joshua-kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot during my last review that we also need to update CONTRIBUTING.md and README.md and the docstring on go.mod and possibly our golangci. See 1ecddc7 as an example.

@joshua-kim joshua-kim dismissed their stale review September 19, 2025 20:16

Bad review

Comment thread go.mod
Comment thread tests/e2e/x/transfer/virtuous.go Outdated
Comment thread ids/bits_test.go Outdated
@StephenButtolph StephenButtolph added this pull request to the merge queue Sep 22, 2025
@StephenButtolph StephenButtolph removed this pull request from the merge queue due to a manual request Sep 22, 2025
@StephenButtolph
Copy link
Copy Markdown
Contributor

I'm not sure that the comment about linting is correct.

$ nix develop
$ task lint
task: [lint] ./scripts/lint.sh
Running 'golangci_lint license_header require_error_is_no_funcs_as_params single_import interface_compliance_nil require_no_error_inline_func import_testing_only_in_tests' at: Mon Sep 22 11:40:53 EDT 2025
START: 'golangci_lint' at Mon Sep 22 11:40:53 EDT 2025
Error: can't load config: the Go language version (go1.23) used to build golangci-lint is lower than the targeted Go version (1.24.7)
Failed executing command with error: can't load config: the Go language version (go1.23) used to build golangci-lint is lower than the targeted Go version (1.24.7)
exit status 3
FAIL: 'golangci_lint' failed at Mon Sep 22 11:41:06 EDT 2025
task: Failed to run task "lint": exit status 255

It seems like we need to be updating the golangci-lint version as well.

@StephenButtolph
Copy link
Copy Markdown
Contributor

actually maybe this is a me issue.

@StephenButtolph
Copy link
Copy Markdown
Contributor

yeah I just needed to update golang locally.

@StephenButtolph StephenButtolph added this pull request to the merge queue Sep 22, 2025
Merged via the queue into master with commit 58e3191 Sep 22, 2025
35 checks passed
@StephenButtolph StephenButtolph deleted the alarso16/go-1.24 branch September 22, 2025 19:32
@github-project-automation github-project-automation bot moved this from In Review 🔎 to Done 🎉 in avalanchego Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants