From fb5a84212c491332504fcdd4b5f4a4b97705d2e3 Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 16 Jun 2021 21:00:49 +0200 Subject: Update dependencies (#1521) --- vendor/google.golang.org/protobuf/internal/detrand/rand.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vendor/google.golang.org/protobuf/internal/detrand') diff --git a/vendor/google.golang.org/protobuf/internal/detrand/rand.go b/vendor/google.golang.org/protobuf/internal/detrand/rand.go index a904dd1f..49c8676d 100644 --- a/vendor/google.golang.org/protobuf/internal/detrand/rand.go +++ b/vendor/google.golang.org/protobuf/internal/detrand/rand.go @@ -26,6 +26,14 @@ func Bool() bool { return randSeed%2 == 1 } +// Intn returns a deterministically random integer between 0 and n-1, inclusive. +func Intn(n int) int { + if n <= 0 { + panic("must be positive") + } + return int(randSeed % uint64(n)) +} + // randSeed is a best-effort at an approximate hash of the Go binary. var randSeed = binaryHash() -- cgit v1.2.3