mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-14 04:07:46 +00:00
Cleanup tests.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package traefikoidc
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
)
|
||||
|
||||
// generateRandomString generates a random string of the specified length
|
||||
// This is used in tests to create unique identifiers
|
||||
func generateRandomString(length int) string {
|
||||
bytes := make([]byte, length/2)
|
||||
if _, err := rand.Read(bytes); err != nil {
|
||||
// In tests, fallback to a predictable string if random fails
|
||||
return "random-string-fallback"
|
||||
}
|
||||
return hex.EncodeToString(bytes)
|
||||
}
|
||||
Reference in New Issue
Block a user