MCPcopy Index your code
hub / github.com/coder/coder / NameWith

Function NameWith

coderd/util/namesgenerator/namesgenerator.go:30–36  ·  view source on GitHub ↗

NameWith returns a random name with a custom delimiter. Names are not guaranteed to be unique.

(delim string)

Source from the content-addressed store, hash-verified

28// NameWith returns a random name with a custom delimiter.
29// Names are not guaranteed to be unique.
30func NameWith(delim string) string {
31 const seed = 0 // gofakeit will use a random crypto seed.
32 faker := gofakeit.New(seed)
33 adjective := strings.ToLower(faker.AdjectiveDescriptive())
34 last := strings.ToLower(faker.LastName())
35 return adjective + delim + last
36}
37
38// NameDigitWith returns a random name with a two-digit suffix (00-99),
39// in the format "[adjective][delim][surname][digit]" e.g. "happy_smith42".

Callers 4

RandomNameFunction · 0.92
generateFallbackFunction · 0.92
NameDigitWithFunction · 0.85
UniqueNameWithFunction · 0.85

Calls 1

NewMethod · 0.65

Tested by

no test coverage detected