You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
Is your feature request related to a problem? Please describe.
I am trying to wire a non-pointer field from a struct to a provider which requires a pointer of the same type
Consider the following
typeConfigstruct {
UserConfigUserConfig
}
funcinitialize(ctx context.Context, cfg*Config) (*st, func(), error) {
panic( // panic to be replaced by generated codewire.Build(
InitializeUser,
wire.FieldsOf(new(Config), "UserConfig"),
),
)
}
funcInitializeUser(config*UserConfig) *User {
// initialize user from user config
}
I am unable to wire the UserConfig field in my Config for the InitializeUser provider without writing a wrapper provider by hand.
Describe the solution you'd like
FieldsOf should provide both a non-pointer and a pointer type of that field. This seems to already be done today by the Struct Providers as per the documentation. It would be useful (and consistent) if FieldsOf would do the same
Describe alternatives you've considered
The alternative it to write your own simple wrapper provider such as