From 90836c801b1701af29e15845d6a6ec128c5a4d54 Mon Sep 17 00:00:00 2001 From: crusader Date: Sat, 7 Apr 2018 01:59:06 +0900 Subject: [PATCH] ing --- registry/registry.go | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/registry/registry.go b/registry/registry.go index acc6040..bbb86cb 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -25,7 +25,7 @@ type ComponentRegistry interface { GetInstance(t reflect.Type) (interface{}, error) GetInstances(ts []reflect.Type) ([]interface{}, error) GetInstanceByName(name string) (interface{}, error) - GetInstancesByAnnotationName(n string) ([]interface{}, error) + // GetInstancesByAnnotationName(n string) ([]interface{}, error) GetInstancesByAnnotationType(t reflect.Type) ([]interface{}, error) } @@ -215,27 +215,27 @@ func (cr *defaultComponentRegistry) GetInstances(ts []reflect.Type) ([]interface // GetInstancesByAnnotationName returns instance of annotated // n must be name of registered annotation -func GetInstancesByAnnotationName(n string) ([]interface{}, error) { - return registry.GetInstancesByAnnotationName(n) -} -func (cr *defaultComponentRegistry) GetInstancesByAnnotationName(n string) ([]interface{}, error) { - var ( - i interface{} - err error - ) - instances := make([]interface{}, 0) +// func GetInstancesByAnnotationName(n string) ([]interface{}, error) { +// return registry.GetInstancesByAnnotationName(n) +// } +// func (cr *defaultComponentRegistry) GetInstancesByAnnotationName(n string) ([]interface{}, error) { +// var ( +// i interface{} +// err error +// ) +// instances := make([]interface{}, 0) - for _, td := range cr.definitionByType { - if nil != td.GetAnnotation(n) { - if i, err = cr.GetInstance(td.Type); nil != err { - return nil, err - } - instances = append(instances, i) - } - } +// for _, td := range cr.definitionByType { +// if nil != td.GetAnnotation(n) { +// if i, err = cr.GetInstance(td.Type); nil != err { +// return nil, err +// } +// instances = append(instances, i) +// } +// } - return instances, nil -} +// return instances, nil +// } func GetInstancesByAnnotationType(t reflect.Type) ([]interface{}, error) { return registry.GetInstancesByAnnotationType(t)