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:
return formats[rand.Intn(len(formats))]
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
import (
"errors"
"fmt"
"math/rand"
"time"
)
func Hello(name string) (string, error) {
rand.Seed(time.Now().UnixNano())
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