-
Notifications
You must be signed in to change notification settings - Fork 664
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.20 updates, add build tag for rand.Seed #1209
Conversation
func init() { | ||
// This is not needed since Go 1.20 because now rand.Seed always happens | ||
// by default (uses runtime.fastrand64 instead as source). | ||
rand.Seed(time.Now().UnixNano()) |
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.
we don't need it now probably but from Go 1.19 it was possible to get call into fastrand64 like this: maphash.Bytes(maphash.MakeSeed(), nil)
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.
This a new file?
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 a new file to add the build tags so that this does not apply to Go +1.20
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.
ok so just copyright 2023..
Signed-off-by: Waldemar Quevedo <wally@nats.io>
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.
LGTM
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.
LGTM
Adds Go 1.20 and also deprecates use of rand.Seed in the client for Go +1.20 series since this is now always done by default (golang/go#54880)
Signed-off-by: Waldemar Quevedo wally@nats.io