Remove random.Seed() call from robot-name's approach file#2853
Remove random.Seed() call from robot-name's approach file#2853HerrSubset wants to merge 1 commit intoexercism:mainfrom
Conversation
|
Just created a forum post for this issue as well. |
|
I'm not involved in the Go track in any way, but I just noticed: |
From the Go documentation on random.Seed(): Deprecated: 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. The time import could then also be removed, because it was only used when setting the seed.
|
Thanks for checking that @siebenschlaefer, I updated the PR. I also tested both examples and saw that the |
SleeplessByte
left a comment
There was a problem hiding this comment.
Looks good. The sample solution didn't seed a random number generator.
Can you confirm these approaches actually pass the tests if ran? If yes, I don't see a reason why this cannot be merged...
|
cc @exercism/go |
Yes, tested that last week after siebenschlaefer's comment :) |
From the Go documentation on random.Seed():
Deprecated: 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.