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

fix: replace deprecated rand.Seed #1436

Merged
merged 3 commits into from
Jan 14, 2025
Merged

Conversation

tenthirtyam
Copy link
Collaborator

Summary

rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0.

As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator.

@tenthirtyam tenthirtyam added technical-debt Technical Debt chore Chore labels Oct 16, 2024
@tenthirtyam tenthirtyam self-assigned this Oct 16, 2024
@tenthirtyam tenthirtyam added needs-review Needs Review size/xs Relative Sizing: extra-small labels Oct 16, 2024
Copy link
Member

@salv-orlando salv-orlando left a comment

Choose a reason for hiding this comment

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

LGTM. @ksamoray can you please have a look at this?

@ksamoray
Copy link
Collaborator

LGTM. @ksamoray can you please have a look at this?

Already did - but would rather wait to have a CI for acceptance tests before merging this (and few of the other changes).

@tenthirtyam
Copy link
Collaborator Author

@vmware/terraform-provider-nsxt-maintainers: reminder.

@tenthirtyam tenthirtyam force-pushed the fix/replace-deprecated-rand.Seed branch from fcf92c6 to ca53e0b Compare January 8, 2025 14:46
@vmwclabot vmwclabot added the dco-required DCO Required label Jan 8, 2025
`rand.Seed` has been deprecated since Go 1.20 and an alternative has been available since Go 1.0.

As of Go 1.20 there is no reason to call `Seed` with a random value. Programs that call `Seed` with a known value to get a specific sequence of results should use `New(NewSource(seed))` to obtain a local random generator.

Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>
@tenthirtyam tenthirtyam force-pushed the fix/replace-deprecated-rand.Seed branch from ca53e0b to 115a29e Compare January 8, 2025 14:48
@vmwclabot vmwclabot removed the dco-required DCO Required label Jan 8, 2025
@vmware vmware deleted a comment from vmwclabot Jan 8, 2025
@salv-orlando
Copy link
Member

@ksamoray If possible can we run acceptance tests for this PR, so we can merge it?

@vmwclabot
Copy link
Member

@tenthirtyam, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot vmwclabot added the dco-required DCO Required label Jan 14, 2025
@ksamoray
Copy link
Collaborator

/test-all

@vmwclabot
Copy link
Member

@tenthirtyam, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@ksamoray
Copy link
Collaborator

/test-all

@ksamoray ksamoray merged commit 22f8578 into master Jan 14, 2025
8 checks passed
@ksamoray ksamoray deleted the fix/replace-deprecated-rand.Seed branch January 14, 2025 11:27
@tenthirtyam tenthirtyam removed the needs-review Needs Review label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore dco-required DCO Required size/xs Relative Sizing: extra-small technical-debt Technical Debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants