@@ -19,21 +19,22 @@ type Injector struct {
1919
2020// NewInjector builds up a new Injector out of a list of Modules with singleton scope
2121func NewInjector (options ... Option ) (* Injector , error ) {
22- mod := & configuration {
23- bindings : make (map [* binding ]bool ),
24- scopes : make (map [string ]Scope ),
22+ conf := & configuration {
23+ bindings : []* binding {},
24+ scopes : make (map [string ]Scope ),
25+ knownProviders : []* provideOption {},
2526 }
2627
27- for _ , o := range options {
28- err := o .apply (mod )
28+ for _ , option := range options {
29+ err := option .apply (conf )
2930 if err != nil {
3031 return nil , err
3132 }
3233 }
3334
3435 singletonScope := newSingletonScope ()
35- mod .scopes [Singleton ] = singletonScope
36- mod .scopes [PerLookUp ] = newPerLookUpScope ()
36+ conf .scopes [Singleton ] = singletonScope
37+ conf .scopes [PerLookUp ] = newPerLookUpScope ()
3738
3839 injector := & Injector {
3940 bindings : make (map [reflect.Type ]map [string ][]* binding ),
@@ -49,8 +50,8 @@ func NewInjector(options ...Option) (*Injector, error) {
4950 scope : Singleton ,
5051 }
5152
52- injector .scopes = mod .scopes
53- for b := range mod .bindings {
53+ injector .scopes = conf .scopes
54+ for _ , b := range conf .bindings {
5455 _ , ok := injector .bindings [b .typeof ]
5556 if ! ok {
5657 injector .bindings [b .typeof ] = make (map [string ][]* binding )
0 commit comments