Is your feature request related to a problem? Please describe.
When a Wire provider function is a trivial method delegate — its only purpose is to call a method on one of its parameters and return the result — it adds boilerplate without any value.
func DatabaseProvider(opts *APIServerDatabaseOptions) (*gorm.DB, error) {
return opts.ToDB()
}
var Set = wire.NewSet(
DatabaseProvider, // wrapper just to call opts.ToDB()
// ...
)
Describe the solution you'd like
support below pattern for simpler provider function passing
var Set = wire.NewSet(
(*APIServerDatabaseOptions).ToDB, // directly use the method
// ...
)
Describe alternatives you've considered
I think this is the simplest way to solve this problem.
Additional context
I used goforj/wire v1.1.0