MCPcopy Create free account
hub / github.com/Pallinder/go-randomdata / FirstName

Function FirstName

random_data.go:124–138  ·  view source on GitHub ↗

FirstName returns a random first name, gender decides the gender of the name

(gender int)

Source from the content-addressed store, hash-verified

122
123// FirstName returns a random first name, gender decides the gender of the name
124func FirstName(gender int) string {
125 var name = ""
126 switch gender {
127 case Male:
128 name = randomFrom(jsonData.FirstNamesMale)
129 break
130 case Female:
131 name = randomFrom(jsonData.FirstNamesFemale)
132 break
133 default:
134 name = FirstName(rand.Intn(2))
135 break
136 }
137 return name
138}
139
140// LastName returns a random last name
141func LastName() string {

Callers 5

FullNameFunction · 0.85
EmailFunction · 0.85
GenerateProfileFunction · 0.85
TestFirstNameFunction · 0.85
ExampleRandomdataFunction · 0.85

Calls 2

randomFromFunction · 0.85
IntnMethod · 0.80

Tested by 2

TestFirstNameFunction · 0.68
ExampleRandomdataFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…