mirror of
https://github.com/jenkinsci/kubernetes-operator.git
synced 2026-10-17 13:25:31 +02:00
Co-authored-by: brokenpip3 <brokenpip3@gmail.com> Co-authored-by: Ansh Garhewal <me@anshdevs.in> Co-authored-by: xmbhasin <xmbhasin@users.noreply.github.com>
21 lines
365 B
Go
21 lines
365 B
Go
package resources
|
|
|
|
import (
|
|
"math/rand"
|
|
"time"
|
|
)
|
|
|
|
var randomCharset = []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
|
|
|
func randomString(n int) string {
|
|
b := make([]rune, n)
|
|
for i := range b {
|
|
b[i] = randomCharset[rand.Intn(len(randomCharset))]
|
|
}
|
|
return string(b)
|
|
}
|
|
|
|
func init() {
|
|
rand.New(rand.NewSource(time.Now().UnixNano()))
|
|
}
|