Golang math/rand.Int31n() function example
package math/rand
Golang math/rand.Int31n() function usage example
package main
import (
"fmt"
"math/rand"
)
func main() {
n := 10
i := 0
var x int32
for i < n {
x = rand.Int31n(10)
fmt.Println("x : ", x)
i += 1
}
fmt.Println("i : ", i)
}
Reference :
Advertisement
Something interesting
Tutorials
+4.9k Nginx and PageSpeed build from source CentOS example
+11.5k Golang : Generate DSA private, public key and PEM files example
+14.4k Android Studio : Use image as AlertDialog title with custom layout example
+7.4k Golang : Convert source code to assembly language
+24.6k Golang : How to validate URL the right way
+6.3k WARNING: UNPROTECTED PRIVATE KEY FILE! error message
+4.6k Mac OSX : Get disk partitions' size, type and name
+9.5k Golang : Accessing content anonymously with Tor
+7.6k Golang : Convert(cast) io.Reader type to string
+9.8k Golang : Qt get screen resolution and display on center example
+7.9k Javascript : Put image into Chrome browser's console
+8.3k Golang : Emulate NumPy way of creating matrix example