Skip to content

Migrate from math/rand to math/rand/v2#4952

Merged
pietern merged 1 commit intomainfrom
go1.22-math-rand-v2
Apr 13, 2026
Merged

Migrate from math/rand to math/rand/v2#4952
pietern merged 1 commit intomainfrom
go1.22-math-rand-v2

Conversation

@pietern
Copy link
Copy Markdown
Contributor

@pietern pietern commented Apr 13, 2026

Summary

  • Replace math/rand with math/rand/v2 and Intn with IntN in the two files that used it
  • Add depguard lint rule to prevent reintroduction of math/rand v1

Per the Go 1.22 release notes, math/rand/v2 is the recommended replacement for math/rand.

This pull request was AI-assisted by Isaac.

@pietern pietern added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit f5003e0 Apr 13, 2026
24 checks passed
@pietern pietern deleted the go1.22-math-rand-v2 branch April 13, 2026 22:06
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.

2 participants