Following up on Ian's post. It is generally a good idea to go to the 
playground <https://play.golang.org/> and make a minimal working "program" 
to demonstrate your question before posting. In doing so you would have 
discovered that the zero value of a rand.Rand can not be used, and will 
panic. 

Also, a tip. You can go to the docs for NewSource at 
https://golang.org/pkg/math/rand/#NewSource, then click on the "NewSource"  
link, and get to the source code at 
https://golang.org/src/math/rand/rand.go?s=1614:1647#L34, which may be 
informative. 



On Tuesday, March 26, 2019 at 2:48:27 PM UTC-4, 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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to