Export RandDurationN

This commit is contained in:
Ian Gulliver
2023-06-11 09:57:48 -07:00
parent d8049f4895
commit 906e3df38a
2 changed files with 12 additions and 7 deletions

10
util.go Normal file
View File

@@ -0,0 +1,10 @@
package elect
import (
"math/rand"
"time"
)
func RandDurationN(n time.Duration) time.Duration {
return time.Duration(rand.Int63n(int64(n))) //nolint:gosec
}