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

Upgrade minimum required Go version to 1.20 #559

Merged
merged 3 commits into from
Feb 28, 2024
Merged

Conversation

cthulhu-rider
Copy link
Contributor

No description provided.

Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

There is also open-coded slice copying in session/common.go and container/container.go as well as a complete copyByteSlice.

I'm also concerned about error wrapping. Do we have any cases or error replacements that can benefit by wrapping multiple errors at the same time?

Comment on lines +31 to 32
//nolint:staticcheck
rand.Read(csRaw[:])

Choose a reason for hiding this comment

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

Why not use rand.Read from the crypto/rand package as the linter suggests? Perhaps it's better to avoid deprecated functions, even in tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unlike usual deprecations, this one tells For almost all use cases.... Tests were and are happy with math rand. I just satisfied the linter

afaik we're doin the same in other repos, right? @roman-khimov

Copy link
Member

Choose a reason for hiding this comment

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

Yes. Technically math/rand is faster and it works fine for tests. We may reconsider this in #552 where the whole math/rand gets replaced with v2.

Go 1.22 was recently released. As always, we require minimum version
before last.

Func `math.Rand.Read` was marked as deprecated, but used for test code
only.

Refs #553.

Signed-off-by: Leonard Lyubich <[email protected]>
New stdlib function was introduced in Go 1.20. It completely replaces
the previously used `slice.Copy` utility. Manual `make`+`copy` no longer
needed too.

Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
@cthulhu-rider
Copy link
Contributor Author

@roman-khimov done

bout errors: found nothing. API status errors wrap apistatus.Error semantically, not structurally

@roman-khimov roman-khimov merged commit 8099e0f into master Feb 28, 2024
5 checks passed
@roman-khimov roman-khimov deleted the upd/553-go-120 branch February 28, 2024 09: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.

4 participants