boyter/scc

Proposal: Upgrade to Go 1.22

apocelipes opened this issue · 2 comments

The go version in the "go.mod" file is "go1.20", however Go 1.20 has entered EOL for more than 5 months.

It's time to upgrade to the latest stable version, currently it is 1.22.5. Go 1.23.0 will be released in the middle of August 2024, the relatively stable 1.23.1 will be released at a much later date.

Benefits of upgrading to Go 1.22:

  • better runtime performances
  • security vulnerability fixes
  • can use the new package "slices", it is faster and simpler than "sort"
  • can use the new package "math/rand/v2", it is much faster and has better randomness than "math/rand".
  • with the new built-in functions "min" and "max",  there's no longer a need to write these functions ourselves.

The upgrade process will be divided into two steps. First, modify the go version in "go.mod" and "Dockerfile" to 1.22 and upgrade dependancies. Then use the new features brought by 1.22 in the codebase to simplify the code and get some minor performance improvements. All these changes can be covered by the tests.

The developer's own toolchain will also need to be upgraded to Go 1.22.

I can split the above two steps into two PRs and submit them up if you agree to upgrade.

Yes sounds good. First part has been merged.

Merged again. Thanks for the submission.