Add RandomInt to tools!
diff --git a/acceptance/tools/tools.go b/acceptance/tools/tools.go
index 04f73c3..35679b7 100644
--- a/acceptance/tools/tools.go
+++ b/acceptance/tools/tools.go
@@ -5,6 +5,7 @@
import (
"crypto/rand"
"errors"
+ mrand "math/rand"
"os"
"time"
@@ -72,6 +73,12 @@
return prefix + string(bytes)
}
+// RandomInt will return a random integer between a specified range.
+func RandomInt(min, max int) int {
+ mrand.Seed(time.Now().Unix())
+ return mrand.Intn(max-min) + min
+}
+
// Elide returns the first bit of its input string with a suffix of "..." if it's longer than
// a comfortable 40 characters.
func Elide(value string) string {