Skip to content

Commit

Permalink
Create a random username generator
Browse files Browse the repository at this point in the history
  • Loading branch information
mingrammer committed May 7, 2019
1 parent 664180b commit 9080b3f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions random.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"math/rand"
"strings"

"github.com/brianvoe/gofakeit"
Expand All @@ -17,3 +18,9 @@ func RandResourceURI() string {
url += "/" + strings.ToLower(strings.Join(slug, "/"))
return url
}

// RandAuthUserID generates a random auth user id
func RandAuthUserID() string {
candidates := []string{"-", strings.ToLower(gofakeit.Username())}
return candidates[rand.Intn(2)]
}

0 comments on commit 9080b3f

Please sign in to comment.