make resolves the binding if needed and returns the resolved concrete.
(c Container)
| 19 | |
| 20 | // make resolves the binding if needed and returns the resolved concrete. |
| 21 | func (b *binding) make(c Container) (interface{}, error) { |
| 22 | if b.concrete != nil { |
| 23 | return b.concrete, nil |
| 24 | } |
| 25 | |
| 26 | retVal, err := c.invoke(b.resolver) |
| 27 | if b.isSingleton { |
| 28 | b.concrete = retVal |
| 29 | } |
| 30 | |
| 31 | return retVal, err |
| 32 | } |
| 33 | |
| 34 | // Container holds the bindings and provides methods to interact with them. |
| 35 | // It is the entry point in the package. |
no test coverage detected