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

Unexpected nested containers behavior #6

Open
samdark opened this issue Feb 18, 2016 · 0 comments
Open

Unexpected nested containers behavior #6

samdark opened this issue Feb 18, 2016 · 0 comments

Comments

@samdark
Copy link
Contributor

samdark commented Feb 18, 2016

https://github.com/go-ozzo/ozzo-di/blob/master/container.go#L222

If type isn't found, it's looked up in parent container and all of its dependencies are looked into parent container only. It doesn't look right to me if I have the following dependency tree:

Foo
  Bar
    Baz
Baz

Primary container has Foo and Baz. Parent container has Bar and Baz.

When building Foo from parent container it goes into parent container to get Bar. Baz is fetched from parent container despite the fact that we have it configured differently in the primary container.

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

No branches or pull requests

1 participant