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

Go 1.22 #3567

Merged
merged 10 commits into from
Sep 2, 2024
Merged

Go 1.22 #3567

merged 10 commits into from
Sep 2, 2024

Conversation

roman-khimov
Copy link
Member

No description provided.

This also changes workflows to test 1.22 and 1.23 only (refs. nspcc-dev/.github#30).
Fixes #3310.

Signed-off-by: Roman Khimov <[email protected]>
LIkely it's more readable this way.

Signed-off-by: Roman Khimov <[email protected]>
It's slightly less efficient (all comparisons are always made), but for
strings/ints it's negligible performance difference, while the code looks a
tiny bit better.

Signed-off-by: Roman Khimov <[email protected]>
Mostly this switches to math/rand/v2, but sometimes randomness is not really needed.

Signed-off-by: Roman Khimov <[email protected]>
It's a bit easier this way, loops that change slices aren't fun.

Signed-off-by: Roman Khimov <[email protected]>
Mostly it's about Go 1.22+ syntax with ranging over integers, but it also
prefers ranging over slices where possible (it makes code a little better to
read).

Notice that we have a number of dangerous loops where slices are mutated
during loop execution, many of these can't be converted since we need proper
length evalutation at every iteration.

Signed-off-by: Roman Khimov <[email protected]>
It's unused. Maybe we can move it out of VM completely decoupling VM from
crypto.

Signed-off-by: Roman Khimov <[email protected]>
Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 96.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 85.79%. Comparing base (ff979e7) to head (565f8cf).
Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
cli/query/query.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3567   +/-   ##
=======================================
  Coverage   85.79%   85.79%           
=======================================
  Files         330      330           
  Lines       38539    38537    -2     
=======================================
- Hits        33063    33062    -1     
+ Misses       3930     3928    -2     
- Partials     1546     1547    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Go 1.22+ allows to drop these:

  The copy of the 'for' variable "i" can be deleted (Go 1.22+) (copyloopvar)

Signed-off-by: Roman Khimov <[email protected]>
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

I tried, but can't find anything suspicious or questionable.

@roman-khimov roman-khimov merged commit d47fe39 into master Sep 2, 2024
20 checks passed
@roman-khimov roman-khimov deleted the go-1.22 branch September 2, 2024 19:32
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 this pull request may close these issues.

3 participants