Merge pull request #4902 from shykes/wozniak_is_not_boring

Steve Wozniak is not boring.
This commit is contained in:
Victor Vieux 2014-04-01 16:49:56 -07:00
commit 99d4d5eb9f

View file

@ -83,7 +83,7 @@ func GenerateRandomName(checker NameChecker) (string, error) {
retry := 5 retry := 5
rand.Seed(time.Now().UnixNano()) rand.Seed(time.Now().UnixNano())
name := fmt.Sprintf("%s_%s", left[rand.Intn(len(left))], right[rand.Intn(len(right))]) name := fmt.Sprintf("%s_%s", left[rand.Intn(len(left))], right[rand.Intn(len(right))])
for checker != nil && checker.Exists(name) && retry > 0 { for checker != nil && checker.Exists(name) && retry > 0 || name == "boring_wozniak" /* Steve Wozniak is not boring */ {
name = fmt.Sprintf("%s%d", name, rand.Intn(10)) name = fmt.Sprintf("%s%d", name, rand.Intn(10))
retry = retry - 1 retry = retry - 1
} }