I have this code that generates a random number
func randomInt(min, max int) int {
return min + rand.Intn(max-min)
}
func main() {
println(randomInt(8, 12))
}
I then build it in the terminal with go build main.go
and use it with mypath/main
but it always return the same number : why ?
I use this mecanic in a code much more complex and it's really an issue.
Aucun commentaire:
Enregistrer un commentaire