Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace deprecated math/rand functions #30733

Merged
merged 2 commits into from
Apr 27, 2024

Conversation

harryzcy
Copy link
Contributor

@harryzcy harryzcy commented Apr 27, 2024

Suggested by logs in #30729

  • Remove math/rand.Seed
    rand.Seed is deprecated: As of Go 1.20 there is no reason to call Seed with a random value.
  • Replace math/rand.Read
    rand.Read is deprecated: For almost all use cases, [crypto/rand.Read] is more appropriate.
  • Replace math/rand with math/rand/v2, which is available since Go 1.22

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 27, 2024
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 27, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Apr 27, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 27, 2024
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 27, 2024
@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Apr 27, 2024
@silverwind silverwind merged commit 7b8e418 into go-gitea:main Apr 27, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Apr 27, 2024
@harryzcy harryzcy deleted the fix-deprecated-rand branch April 27, 2024 16:50
silverwind added a commit to silverwind/gitea that referenced this pull request Apr 27, 2024
* origin/main:
  Replace deprecated `math/rand` functions (go-gitea#30733)
  Make Ctrl+Enter work for issue/comment edit (go-gitea#30720)
  Rename migration package name for 1.22-rc1 (go-gitea#30730)
  Issue card improvements (go-gitea#30687)
  Don't show loading indicators when refreshing the system status (go-gitea#30712)
  Add some tests to clarify the "must-change-password" behavior (go-gitea#30693)
  Prevent allow/reject reviews on merged/closed PRs (go-gitea#30686)
  Update JS dependencies (go-gitea#30713)
  Improve diff stats bar (go-gitea#30669)
  Remove unused parameter for some functions in `services/mirror` (go-gitea#30724)
  Update misspell to 0.5.1 and add `misspellings.csv` (go-gitea#30573)
  Suppress browserslist warning in webpack target (go-gitea#30571)
  [skip ci] Updated translations via Crowdin
  Diff color enhancements, add line number background (go-gitea#30670)
  feat(api): enhance Actions Secrets Management API for repository (go-gitea#30656)
  Fix code search input for different views (go-gitea#30678)
  Fix incorrect object id hash function (go-gitea#30708)
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 28, 2024
* giteaofficial/main:
  Use `ProtonMail/go-crypto` for `opengpg` in tests (go-gitea#30736)
  Replace deprecated `math/rand` functions (go-gitea#30733)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jul 26, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants