faker
faker copied to clipboard
Consideration about keep tag
I love faker and I use it a lot on my tests. Something like this:
type User struct {
Id uint64 `faker:"-"`
Email string
Username string
FirstName string
LastName string
}
user := User{Username: "John"}
faker.FakeData(&user) // I want all fake data except for `Username` because it was set manually
In practice, I want the faker:"keep" tag always. I don't know if also other users have this need. But for me, the keep tag should be the default behavior. This is also the default behavior for gems like FactoryBot for Ruby. So what I propose is to remove the keep tag and add a new one with the opposite effect, something like replace. Or a global configuration (faker.EnableKeepDefaultBehaviour())
What do you think guys?
Is using the ignore tag is not enough? Hmm...
it'll take time to investigate this, I wonder if you have time, you can do it first.