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

is wire.FieldsOf support any field ? #387

Open
frankiezdh opened this issue Jul 20, 2023 · 2 comments
Open

is wire.FieldsOf support any field ? #387

frankiezdh opened this issue Jul 20, 2023 · 2 comments

Comments

@frankiezdh
Copy link

Is your feature request related to a problem? Please describe.

A struct which is read from configuration file provide all its fields.

The sulotion now is wire.FieldsOf(new(*Cfg), "Field1", "Field2")

Describe the solution you'd like

wire.FieldsOf support any field, like wire.FieldsOf(new(*Cfg), "*")

Describe alternatives you've considered

The sulotion now is wire.FieldsOf(new(*Cfg), "Field1", "Field2")

Additional context

@ProgrammingMuffin
Copy link

Hi @frankiezdh, wire.FieldsOf(new(*Cfg), "Field1", "Field2") provides two return values, it would be really helpful if you could give an example code snippet of how you have used the return values.

@osousa
Copy link

osousa commented Jun 17, 2024

This is really useful , i made a fork and implemented the feature

https://github.com/osousa/drato

Be warned that if any type is previously injected or if types aren't unique, then it will complain. It still works as intended originally if passing the fieldnames

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

3 participants