We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://go.dev/doc/tutorial/random-greeting
Does not matter
The greetings example uses:
return formats[rand.Intn(len(formats))]
Without initializing the source/seed for random entropy.
The provided example code returns random values.
Same output every time when I run
go run .
on hello module from tutorial.
It can be fixed by changing original code the
import ( "errors" "fmt" "math/rand" "time" ) func Hello(name string) (string, error) { rand.Seed(time.Now().UnixNano())
The text was updated successfully, but these errors were encountered:
see the deprecation notice for seeding
Sorry, something went wrong.
No branches or pull requests
What is the URL of the page with the issue?
https://go.dev/doc/tutorial/random-greeting
What is your user agent?
Does not matter
Screenshot
Does not matter
What did you do?
The greetings example uses:
Without initializing the source/seed for random entropy.
What did you expect to see?
The provided example code returns random values.
What did you see instead?
Same output every time when I run
on hello module from tutorial.
It can be fixed by changing original code the
The text was updated successfully, but these errors were encountered: