Skip to content

Application fails to start with fx.Annotate + fx.As + fx.In + fx.Out #924

Answered by sywhang
noam-ma-ma asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry if this behavior was unexpected. I thought the documentation is pretty clear on what fx.Annotate does, but I guess it can be confusing. Agreed with @silverspace, this may come across as a surprising behavior if you misunderstand what the documentation meant to say.

The docs say:

Annotate lets you annotate a function's parameters and returns without you having to declare separate struct definitions for them.

To give you a little bit of background, Annotate() was added so that it can be used instead of fx.In or fx.Out structs. It was never meant to be a complementary thing.

Then, fx.As came along, and we added it as part of the fx.Annotate annotations set.

Technically, you can still…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by sywhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #923 on August 19, 2022 06:16.