uber-go/fx

Verify invalid tags passed to fx.Annotate

Closed this issue · 1 comments

Some tags passed with fx.Annotate looks a struct tag like this:
fx.Annotate(f, fx.ParamTags(`group:"myGroup"`))

Unfortunately I got very little sleep last night so I fatfingered and made a typo like this while testing something:
fx.Annotate(f, fx.ParamTags(`group:'myGroup"`))

It took a while to find out what was wrong because Fx (technically, Dig) silently ignored this tag.

We could add a verification in Fx to see if the tags are "valid" before passing them to Dig and bail out if the tags are not valid tags that Dig understands.

One other thing I noticed about tags, is that if you provide more tags than there are inputs to f it will ignore the extra tags, perhaps this should return error?