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.20 updates, add build tag for rand.Seed #1209

Merged
merged 1 commit into from
Feb 13, 2023
Merged

Go 1.20 updates, add build tag for rand.Seed #1209

merged 1 commit into from
Feb 13, 2023

Conversation

wallyqs
Copy link
Member

@wallyqs wallyqs commented Feb 10, 2023

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

@coveralls
Copy link

coveralls commented Feb 10, 2023

Coverage Status

Coverage: 85.539% (+0.02%) from 85.522% when pulling 66adc12 on go-120 into 7971018 on main.

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())
Copy link
Member Author

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)

Copy link
Member

Choose a reason for hiding this comment

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

This a new file?

Copy link
Member Author

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

Copy link
Member

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>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@piotrpio piotrpio left a comment

Choose a reason for hiding this comment

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

LGTM

@wallyqs wallyqs merged commit 2805753 into main Feb 13, 2023
@wallyqs wallyqs deleted the go-120 branch February 13, 2023 16:03
@piotrpio piotrpio mentioned this pull request Feb 24, 2023
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.

None yet

4 participants