mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 15:57:32 +00:00

# Which Problems Are Solved Flakiness in integration tests regarding gofakeit functions, which provided the same names on 2 different occasions. # How the Problems Are Solved Attach a random string to the provided names, so that they are not dependent on the gofakeit code. # Additional Changes None # Additional Context None --------- Co-authored-by: Marco A. <marco@zitadel.com>
21 lines
313 B
Go
21 lines
313 B
Go
package integration
|
|
|
|
import (
|
|
"math/rand"
|
|
"time"
|
|
)
|
|
|
|
func init() {
|
|
rand.NewSource(time.Now().UnixNano())
|
|
}
|
|
|
|
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz")
|
|
|
|
func RandString(n int) string {
|
|
b := make([]rune, n)
|
|
for i := range b {
|
|
b[i] = letterRunes[rand.Intn(len(letterRunes))]
|
|
}
|
|
return string(b)
|
|
}
|