You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 8, 2022. It is now read-only.
Sometimes it is useful to generate randomly optional fields, such as the last name (but really - almost any field).
Is it possible to do something like this:
firstName:=faker.FirstName()
lastName:=faker.Optional(.5).LastName() // <-- Generate non-empty last name 50% of the timefullName:=firstNameiflastName!="" {
fullName+=" "+lastName
}
println("Hello, "+fullName+"!")
Here faker.LastName() would return empty string 50% of the time.