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:
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
Hello @StephenGrider,
I noticed that the
deck.gofile in your repository is using themath/randpackage for shuffling the deck of cards. With the release of Go 1.22, a new packagemath/rand/v2has been introduced, which provides additional features and improvements over the originalmath/randpackage.I would like to propose an update to the
deck.gofile to take advantage of the newmath/rand/v2package. Specifically, I suggest removing the following lines:and change package into:
and changing:
to:
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