-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
d17abb5
to
185f47b
Compare
There was a problem hiding this 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?
//nolint:staticcheck | ||
rand.Read(csRaw[:]) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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]>
185f47b
to
655fc71
Compare
@roman-khimov done bout errors: found nothing. API status errors wrap |
No description provided.