Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Added method Resolve and ResolveByName #21

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

emanuel-v-r
Copy link

@emanuel-v-r emanuel-v-r commented Jul 5, 2018

In order to be able to get previously provided instances on demand I have created the method "Resolve" and "ResolveByName". You can pass a pointer of a interface variable or struct variable.
This also satisfies the issue #19

The usage should be something like this:

var g inject.Graph
a := &TypeAnswerStruct{answer: 1, private: 2}
g.Provide(&inject.Object{Value: a})

var result Answerable

err := g.Resolve(&result)

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants