Golang math/rand.Uint32() function example
package math/rand
Golang math/rand.Uint32() function usage example
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
n := 10
i := 0
r := rand.New(rand.NewSource(time.Now().UnixNano()))
for i < n {
x := r.Uint32()
fmt.Println(x)
i += 1
}
}
Reference :
Advertisement
Something interesting
Tutorials
+29.9k Golang : How to get HTTP request header information?
+15.2k Golang : Save(pipe) HTTP response into a file
+48.1k Golang : How to convert JSON string to map and slice
+4.7k JavaScript: Add marker function on Google Map
+16.3k Golang : Loop each day of the current month example
+26k Golang : Convert IP address string to long ( unsigned 32-bit integer )
+10.3k Golang : Embed secret text string into binary(executable) file
+8.2k Golang : Get final or effective URL with Request.URL example
+16.3k Golang :Trim white spaces from a string
+37.5k Upload multiple files with Go
+17.2k Google Chrome : Your connection to website is encrypted with obsolete cryptography
+19.6k Golang : Close channel after ticker stopped example