Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use subfactories? #9

Open
nikitakhliestov opened this issue Oct 23, 2023 · 1 comment
Open

How to use subfactories? #9

nikitakhliestov opened this issue Oct 23, 2023 · 1 comment

Comments

@nikitakhliestov
Copy link

nikitakhliestov commented Oct 23, 2023

Currently, it feels like one should put a related factory in the defaults, like:

			Defaults: map[string]any{
				"Reason": func(iteration int, fieldName string) interface{} {
					orderPay := ReasonFactory.Build()
					return &orderPay
				},
			},

But that feels clumsy.
Are there more elegant ways to do that?

@Goldziher
Copy link
Owner

Not at present, but I'm open to suggestions

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

No branches or pull requests

2 participants