Open OldSmokeGun opened 1 year ago
You can use workaround like this
wire.NewSet(
newDb,
ent.New,
redis.New,
discovery.New,
casbin.New,
grpc.New,
uid.New,
)
func newDb(conf config.DBConfigDefault, logger *slog.Logger) (db config.DBInstanceDefault, cleanup func(), err error) {
return db.New[config.DBConfigDefault, config.DBInstanceDefault]
}
Describe the bug
Wire doesn't support generics when I pass a generic function in wire.NewSet
To Reproduce
Pass generic function in wire.NewSet, like this:
or
Then, wire reports an error like this:
Expected behavior
can generate code correctly
Version
github.com/google/wire v0.5.1-0.20220620021424-0675cdc9191c
Additional context
Here is my code: