commit | 0663189610a2b7a0734404c8e3c69f1ea50a4593 | [log] [tgz] |
---|---|---|
author | David K. Bainbridge <dbainbri@ciena.com> | Thu Aug 19 13:07:00 2021 +0000 |
committer | David K. Bainbridge <dbainbri@ciena.com> | Tue Oct 05 17:58:49 2021 +0000 |
tree | c3a9db3abc5d64cc92f5640bc17c28bfdb12623d | |
parent | ba4eb67ac74ee225d83b52c42d0d8e018617c9cc [diff] |
gRPC migration Change-Id: I3129ae27d7ee12a23c7046f0d877e8064f2fd7f4
diff --git a/vendor/google.golang.org/protobuf/internal/detrand/rand.go b/vendor/google.golang.org/protobuf/internal/detrand/rand.go index a904dd1..49c8676 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 @@ 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()