refactor: split out more code into separate files

This commit is contained in:
Simon Aronsson 2019-07-22 10:20:11 +02:00
parent a425bf1024
commit 6c507433e8
3 changed files with 87 additions and 68 deletions

View file

@ -0,0 +1,15 @@
package util
import "math/rand"
var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
// RandName Generates a random, 32-character, Docker-compatible container name.
func RandName() string {
b := make([]rune, 32)
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
}
return string(b)
}