Golang math/rand.Int63n() function example
package math/rand
Golang math/rand.Int63n() function usage example
package main
import (
"fmt"
"math/rand"
)
func main() {
n := 10
i := 0
for i < n {
x := rand.Int63n(10)
fmt.Println(i, x)
i += 1
}
fmt.Println("i : ", i)
}
Reference :
Advertisement
Something interesting
Tutorials
+4.7k Unix/Linux : How to pipe/save output of a command to file?
+12.1k Golang : Sort and reverse sort a slice of runes
+37.5k Golang : Converting a negative number to positive number
+7k Golang : Levenshtein distance example
+25.2k Golang : Storing cookies in http.CookieJar example
+14.5k Golang : How to check if your program is running in a terminal
+8.3k Golang : Oanda bot with Telegram and RSI example
+5.6k Python : Print unicode escape characters and string
+3.7k Golang : Switch Redis database redis.NewClient
+12.6k Golang : Drop cookie to visitor's browser and http.SetCookie() example
+32.1k Golang : Validate email address with regular expression
+13.7k Golang : Tutorial on loading GOB and PEM files