I want to know do we have to call rand.Seed(n)
manually in Go?
I have a code that looks like this:
import (
"fmt"
"math/rand"
)
func main() {
fmt.Println(rand.Intn(100))
fmt.Println(rand.Intn(100))
fmt.Println(rand.Intn(100))
}
Everytime I run this code, each line prints different numbers than the others.
So do I need to call rand.Seed(n)
each time before calling rand.Intn(100)
?