probably because no default seed suitable for most purposes has been
found (and 1 is as good a guess as any). crypto/rand probably behaves
closer to what you expect, but it's a completely different mechanism
best used sparingly. it can give you a good seed though, when you need
one.
Just to add another piece of info:
play.golang.org caches the result of runs, so if you type the same
program twice there is a possibility that the response will be fetched
from cache instead of being compiled and runned.
So even if you changed the Seed you could observe the same results
(when running on the play.golang.org).
To make sure that your are with a fresh result, change something
before running or run the code on your computer.
--
André Moraes
http://andredevchannel.blogspot.com/
Just to add another piece of info:>
> I observe strange behavior. Seems pseudo random generator is indeed
> very pseudo. It generates same set of values on every program run. Try
> following:
> http://play.golang.org/p/3Syxa7YJr9
>
> Run this code several times and you will be same sequence of values
> every time, I think this is not normal. Is this a bug?
play.golang.org caches the result of runs, so if you type the same
program twice there is a possibility that the response will be fetched
from cache instead of being compiled and runned.
So even if you changed the Seed you could observe the same results
(when running on the play.golang.org).
Is there an idiomatic way to set the random number seed if we want a different one for every one (some specific call to the time or something)? I realize there are different ways one could do it, and there are sometimes specific considerations, but I'm just wondering if there is a "standard" way to do it