-
Notifications
You must be signed in to change notification settings - Fork 610
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
wire.NewSet support generics #381
Comments
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]
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
The text was updated successfully, but these errors were encountered: