New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tour: rand.Seed suggestion does not work #12
Comments
From the page you linked:
|
We should probably mention that you need to seed it with something that is not the time. The time is always the same in the playground. |
This is not good :( , it confuse lots of people. If the time is kept constant, it has to be notified somehow to an end user or at least when they use "time" package in playground. |
Fixes golang/tour#12 Change-Id: I3e31796e68052c424ef6b5670aac516e461d1809 Reviewed-on: https://go-review.googlesource.com/44931 Reviewed-by: Andrew Gerrand <adg@golang.org> X-Tour-Commit: d844dc7a157c5d2e92bccc9732530c37bc7ef33b
Fixes golang/tour#12 Change-Id: I3e31796e68052c424ef6b5670aac516e461d1809 Reviewed-on: https://go-review.googlesource.com/44931 Reviewed-by: Andrew Gerrand <adg@golang.org> X-Tour-Commit: d844dc7a157c5d2e92bccc9732530c37bc7ef33b
Fixes golang/tour#12 Change-Id: I3e31796e68052c424ef6b5670aac516e461d1809 Reviewed-on: https://go-review.googlesource.com/44931 Reviewed-by: Andrew Gerrand <adg@golang.org>
Context: https://tour.golang.org/basics/1
I wanted to get a different number each time from this example, so I took the suggestion to seed the number generator.
Here is my code:
When I execute the above code in the tour, the same number is returned every time as if seeding the number generator has no effect.
When I execute this code locally (go version go1.6.2 darwin/amd64) it returns a different number each time as expected.
The text was updated successfully, but these errors were encountered: