-
Notifications
You must be signed in to change notification settings - Fork 624
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 can not recognize the alias any of interface{} in go 1.18.2 #361
Comments
go 1.18.2 func (db *DB) ExecContext(ctx context.Context, query string, args ...any) (Result, error) { lower version func (db *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error) { |
Hey @xiazemin, I tried reproing your failure with the following two file, but wire ran successfully for me. Do you have a repro that I can follow?
|
I believe I have the same or similar error. First the error message I see (note the file in question is not a wire.go file): The line in question: db.Query is defined with '...any': I FIXED it by uninstalling wire and reinstalling wire using go 1.18.4. I think the issue is that wire on my system was compiled long ago before Go 1.18 came out. 'any' was introduced in Go 1.18 so that old existing binary didn't know what 'any' was. It works just fine after cleaning out the old wire binary and reinstalling the same version, but compiled with Go 1.18 |
I agree and verify. |
You can use
go bug
to have a cool, automatically filled out bug template, orfill out the template below.
Describe the bug
cannot use (*sql.DB)(db) (value of type *sql.DB) as sqlc.DBTX value in argument to sqlc.New: wrong type for method ExecContext (have func(ctx context.Context, query string, args ...invalid type) (database/sql.Result, error), want func(context.Context, string, ...interface{}) (database/sql.Result, error))
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior.
Expected behavior
A clear and concise description of what you expected to happen.
Version
go1.18.2
Which version of Wire are you seeing the bug with?
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: