Golang math/rand.Int() function example
package math/rand
Golang math/rand.Int() function usage example
package main
import (
"fmt"
"math/rand"
)
func main() {
n := 10
i := 0
var x int
for i < n {
x = rand.Int()
i += 1
}
fmt.Println("x : ", x)
fmt.Println("i : ", i)
}
Reference :
Advertisement
Something interesting
Tutorials
+14.9k Golang : How to check for empty array string or string?
+25.7k Golang : How to write CSV data to file
+8.5k Golang : How to check variable or object type during runtime?
+5k Golang : Calculate a pip value and distance to target profit example
+10.1k Golang : Compare files modify date example
+21.7k Golang : Setting up/configure AWS credentials with official aws-sdk-go
+12.2k Golang : Get remaining text such as id or filename after last segment in URL path
+13.4k Golang : Verify token from Google Authenticator App
+8.8k Golang : Take screen shot of browser with JQuery example
+6.9k Default cipher that OpenSSL used to encrypt a PEM file
+15k Golang : How do I get the local IP (non-loopback) address ?
+21.6k Golang : GORM create record or insert new record into database example