This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Description
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 time
fullName := firstName
if lastName != "" {
fullName += " " + lastName
}
println("Hello, " + fullName + "!")
Here faker.LastName() would return empty string 50% of the time.