If you use the same seed the source will output the same pseudo-random output. Which is quite useful when you need to be able to replay/predict the random behaviour
On Tuesday, 26 March 2019 19:48:27 UTC+1, Liam wrote: > > Could anyone clarify the difference between these two? > > r := rand.New(rand.NewSource(...)) > > var r rand.Rand; r.Seed(...) > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/16019508-3ce4-4c0a-9197-07559dca63ca%40googlegroups.com.