-
Notifications
You must be signed in to change notification settings - Fork 629
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: FieldsOf now provides a pointer to the field type as well as the actual field type #209
Conversation
… actual field type
Please edit the title of this pull request with the name of the affected component, or "all", followed by a colon, followed by a short summary of the change. |
docs/guide.md
Outdated
@@ -231,12 +231,13 @@ have a provider in the same set that provides the concrete type. | |||
[type identity]: https://golang.org/ref/spec#Type_identity | |||
[return concrete types]: https://github.com/golang/go/wiki/CodeReviewComments#interfaces | |||
|
|||
### Struct Providers | |||
### Injected Structs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworded this section a bit; I found it a bit confusing since FieldsOf
is really using structs as providers, whereas Struct
is injecting a struct. Feedback welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding of the term "provider" in wire means the "initialization function" that provides a certain type. For wire.Struct
, the provider is the generated code that populates the struct, for wire.FieldsOf
, the provider is the generated code that returns the asked fields. In this case the title "Struct Providers" looks accurate to me. While one can argue the title below for FieldsOf
is confusing, I would change it to something like "Struct Fields Providers" or "Injecting Fields of Structs".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to push?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry, done.
docs/guide.md
Outdated
@@ -231,12 +231,13 @@ have a provider in the same set that provides the concrete type. | |||
[type identity]: https://golang.org/ref/spec#Type_identity | |||
[return concrete types]: https://github.com/golang/go/wiki/CodeReviewComments#interfaces | |||
|
|||
### Struct Providers | |||
### Injected Structs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding of the term "provider" in wire means the "initialization function" that provides a certain type. For wire.Struct
, the provider is the generated code that populates the struct, for wire.FieldsOf
, the provider is the generated code that returns the asked fields. In this case the title "Struct Providers" looks accurate to me. While one can argue the title below for FieldsOf
is confusing, I would change it to something like "Struct Fields Providers" or "Injecting Fields of Structs".
Fixes #208.