We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 generates broken code. It generates function body without return statement.
Run wire with following file
wire
// +build wireinject package storage import "github.com/google/wire" type MyInterface interface { Method() } type MyImplementation struct{} func (MyImplementation) Method() {} func XXX(MyImplementation) MyInterface { wire.Build(wire.Bind(new(MyInterface), new(MyImplementation))) return nil }
It will generate following file
// Code generated by Wire. DO NOT EDIT. //go:generate wire //+build !wireinject package storage // Injectors from missed_return.go: func XXX(myImplementation MyImplementation) MyInterface { } // missed_return.go: type MyInterface interface { Method() } type MyImplementation struct{} func (MyImplementation) Method() {}
Wire should generate following file
//+build !wireinject package storage // Injectors from missed_return.go: func XXX(myImplementation MyImplementation) MyInterface { return myImplementation } // missed_return.go: type MyInterface interface { Method() } type MyImplementation struct{} func (MyImplementation) Method() {}
github.com/google/wire v0.3.0 go version go1.13 darwin/amd64
The text was updated successfully, but these errors were encountered:
Thanks for the bug report! Expect a fix in the next week or so.
Sorry, something went wrong.
internal/wire: use set to determine which argument to use in zero-cal…
a5bb544
…l injectors Fixes google#222
b730ad0
…l injectors (#223) Fixes #222
zombiezen
Successfully merging a pull request may close this issue.
Bug description
Wire generates broken code. It generates function body without return statement.
To Reproduce
Run
wire
with following fileIt will generate following file
Expected behavior
Wire should generate following file
Version
github.com/google/wire v0.3.0
go version go1.13 darwin/amd64
The text was updated successfully, but these errors were encountered: