package main import ( "fmt" "math/rand" "time" ) func main() { rand.Seed(time.Now().UnixNano()) // Seed the generator num := rand.Int63() fmt.Println(num) }
package main import ( "fmt" "math/rand" "time" ) func main() { rand.Seed(time.Now().UnixNano()) for i := 0; i < 5; i++ { num := rand.Int63() fmt.Println(num) } }This code generates and prints 5 random int64 numbers to the console. In both examples, the `math/rand` package is used for generating random numbers.