-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Hello @StephenGrider,
I noticed that the deck.go file in your repository is using the math/rand package for shuffling the deck of cards. With the release of Go 1.22, a new package math/rand/v2 has been introduced, which provides additional features and improvements over the original math/rand package.
I would like to propose an update to the deck.go file to take advantage of the new math/rand/v2 package. Specifically, I suggest removing the following lines:
source := rand.NewSource(time.Now().UnixNano())
r := rand.New(source)and change package into:
import "math/rand/v2"and changing:
newPosition := r.Intn(len(d) - 1)to:
newPosition := rand.IntN(len(d) - 1)This change will not only make use of the newer package but also simplify the code by eliminating the need for creating a new source and random number generator instance.
Please let me know if you have any concerns or if you would like me to make the changes directly through a pull request.
Thank you for accepting my PR
I will send a pull request for this improvement. Please accept it.
Regards,
Younes Mahmoudi