Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Consideration about keep tag #117

Open
pioz opened this issue Jun 27, 2020 · 1 comment
Open

Consideration about keep tag #117

pioz opened this issue Jun 27, 2020 · 1 comment

Comments

@pioz
Copy link
Contributor

pioz commented Jun 27, 2020

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?

@bxcodec
Copy link
Owner

bxcodec commented Oct 9, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants