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
I used to write type method instead of a single NewXxx. eg:
// declare NewDog method, which belong to type Animals type Animals struct{} func NewAnimals() *Animals { return &Animals{} } type Dog struct{} func (f *Animals) NewDog() *Dog { return &Dog{} }
frustrated when I want to use it as wire provider, I got unknown pattern error. eg:
unknown pattern
// wire.go //+build wireinject //go:generate wire func InitDog() *animals.Dog { panic(wire.Build( animals.NewAnimals, (*animals.Animals).NewDog, // this line will trigger error )) }
I want the above usage could be work. Generated code should looks like:
// wire_gen.go func InitDog() *animals.Dog { animalsAnimals := animals.NewAnimals() dog := (*animals.Animals).NewDog(animalsAnimals) return dog }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
I used to write type method instead of a single NewXxx. eg:
frustrated when I want to use it as wire provider, I got
unknown pattern
error. eg:Describe the solution you'd like
I want the above usage could be work. Generated code should looks like:
The text was updated successfully, but these errors were encountered: