Skip to content
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

Add test for cases: replace by value and replace by constructor #942

Closed

Conversation

zenthangplus
Copy link

Issue:

  • Replace by value: work
  • Replace by constructor: not work

@sywhang
Copy link
Contributor

sywhang commented Sep 23, 2022

This is expected behavior. fx.Replace only works on values.

Refer to the documentation: https://pkg.go.dev/go.uber.org/fx#Replace

Replace provides instantiated values for graph modification as if they had been provided using a decorator with fx.Decorate. The most specific type of each value (as determined by reflection) is used.

@sywhang sywhang closed this Sep 23, 2022
@sywhang
Copy link
Contributor

sywhang commented Sep 23, 2022

Please also use our https://github.com/uber-go/fx/discussions section to see if it's a bug rather than opening PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants