Rand kits for Golang development.
go get -u github.com/likexian/gokit
import (
"github.com/likexian/gokit/xrand"
)
Visit the docs on GoDoc
n := xrand.Int(10000)
fmt.Println("rand int between 0 and 10000 is:", n)
n := xrand.IntRange(1000, 10000)
fmt.Println("rand int between 1000 and 10000 is:", n)
b, err := xrand.Bytes(10)
if err != nil {
fmt.Println("rand bytes:", b)
}
Copyright 2012-2024 Li Kexian
Licensed under the Apache License 2.0
If this project is helpful, please share it with friends.
If you want to thank me, you can give me a cup of coffee.