mactsouk / mGo4th

Source code for Mastering Go, 4th edition.
MIT License
41 stars 30 forks source link

randomNumbers.go deprecated use of rand.Seed #2

Closed rgerardi closed 12 months ago

rgerardi commented 1 year ago

Deprecated use of rand.Seed in randomNumbers.go

From Go Doc:

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.
mactsouk commented 12 months ago

@rgerardi You are correct. I am going to mention it on Chapter 14 where I will talk about forthcoming Go versions + backwards compatibility.