containerized-data-importer/pkg/util/util.go
John Griffith 8ca745b700 Run gofmt on our directories (#370)
Just do a simple `gofmt -s -w` on pkg, tests and controller directories
to fix the misc space/tab mixes and some other ez formatting issues.
2018-08-23 15:31:14 -07:00

17 lines
307 B
Go

package util
import (
"math/rand"
"time"
)
func RandAlphaNum(n int) string {
rand.Seed(time.Now().UnixNano())
var letter = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
b := make([]rune, n)
for i := range b {
b[i] = letter[rand.Intn(len(letter))]
}
return string(b)
}