mirror of
https://github.com/jimeh/rands.git
synced 2026-02-19 11:26:38 +00:00
18 lines
282 B
Go
18 lines
282 B
Go
package rands_test
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/jimeh/rands"
|
|
)
|
|
|
|
func ExampleInt() {
|
|
n, _ := rands.Int(2147483647)
|
|
fmt.Printf("%d\n", n) // => 1334400235
|
|
}
|
|
|
|
func ExampleInt64() {
|
|
n, _ := rands.Int64(int64(9223372036854775807))
|
|
fmt.Printf("%d\n", n) // => 8256935979116161233
|
|
}
|