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
+7k Web : How to see your website from different countries?
+12.2k Golang : Get remaining text such as id or filename after last segment in URL path
+5.6k PHP : Fix Call to undefined function curl_init() error
+9.5k Golang : Convert(cast) string to int64
+7k Golang : constant 20013 overflows byte error message
+11.9k Golang : Convert decimal number(integer) to IPv4 address
+12k Golang : Clean formatting/indenting or pretty print JSON result
+9.1k Golang : How to capture return values from goroutines?
+8k Findstr command the Grep equivalent for Windows
+17.4k Golang : Multi threading or run two processes or more example
+11.6k Swift : Convert (cast) Float to String
+7.7k Golang : get the current working directory of a running program