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
+11.6k Golang : Simple file scaning and remove virus example
+10.6k Golang : How to unmarshal JSON inner/nested value and assign to specific struct?
+28.6k Get file path of temporary file in Go
+5.4k Golang : Qt update UI elements with core.QCoreApplication_ProcessEvents
+10.1k Golang : Edge detection with Sobel method
+5k Golang : Calculate a pip value and distance to target profit example
+19.9k Golang : Count JSON objects and convert to slice/array
+16.1k Golang : How to check if input from os.Args is integer?
+5k Google : Block or disable caching of your website content
+12.7k Golang : Remove or trim extra comma from CSV
+16k Golang : How to reverse elements order in map ?