matterbridge/vendor/github.com/hashicorp/golang-lru/testing.go

17 lines
227 B
Go
Raw Normal View History

2023-01-28 22:57:53 +01:00
package lru
import (
"crypto/rand"
"math"
"math/big"
"testing"
)
func getRand(tb testing.TB) int64 {
out, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64))
if err != nil {
tb.Fatal(err)
}
return out.Int64()
}