From e216cb7671432e9ee7592bcff88b51ffd391ed25 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 21 Mar 2018 21:19:27 +0900 Subject: [PATCH] ing --- registry/registry.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/registry/registry.go b/registry/registry.go index 96abeb9..76cdfc0 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -151,7 +151,8 @@ func (cr *defaultComponentRegistry) GetInstance(t reflect.Type) (interface{}, er } if annotation = fd.GetAnnotationByType(reflect.TypeOf((*cdia.Inject)(nil)), false); nil != annotation { - if fV, err = cr.GetInstance(fd.Type); nil != err { + fV, err = cr.GetInstance(fd.Type) + if nil != err { return nil, err } } @@ -161,7 +162,8 @@ func (cr *defaultComponentRegistry) GetInstance(t reflect.Type) (interface{}, er if "" == n { n = fd.FieldName } - if fV, err = cr.GetInstanceByName(n); nil != err { + fV, err = cr.GetInstanceByName(n) + if nil != err { return nil, err } } @@ -200,7 +202,8 @@ func (cr *defaultComponentRegistry) GetInstances(ts []reflect.Type) ([]interface ) instances := make([]interface{}, 0) for _, t := range ts { - if i, err = cr.GetInstance(t); nil != err { + i, err = cr.GetInstance(t) + if nil != err { return nil, err } instances = append(instances, i) @@ -223,7 +226,8 @@ func (cr *defaultComponentRegistry) GetInstancesByAnnotationName(n string) ([]in for _, td := range cr.definitionByType { if nil != td.GetAnnotation(n) { - if i, err = cr.GetInstance(td.Type); nil != err { + i, err = cr.GetInstance(td.Type) + if nil != err { return nil, err } instances = append(instances, i)