Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Upgrade to Go 1.22 #488

Closed
apocelipes opened this issue Jul 11, 2024 · 2 comments · Fixed by #492
Closed

Proposal: Upgrade to Go 1.22 #488

apocelipes opened this issue Jul 11, 2024 · 2 comments · Fixed by #492

Comments

@apocelipes
Copy link
Contributor

apocelipes commented Jul 11, 2024

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.

apocelipes added a commit to apocelipes/scc that referenced this issue Jul 11, 2024
boyter pushed a commit that referenced this issue Jul 21, 2024
@boyter
Copy link
Owner

boyter commented Jul 21, 2024

Yes sounds good. First part has been merged.

apocelipes added a commit to apocelipes/scc that referenced this issue Jul 22, 2024
apocelipes added a commit to apocelipes/scc that referenced this issue Jul 22, 2024
boyter pushed a commit that referenced this issue Jul 22, 2024
@boyter
Copy link
Owner

boyter commented Jul 22, 2024

Merged again. Thanks for the submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants