resource bug fixed
This commit is contained in:
parent
a38788fb7f
commit
35e3b97fb9
14
registry.go
14
registry.go
|
@ -168,6 +168,7 @@ func (r *InstanceRegistry) GetInstance(t reflect.Type) (instance interface{}, er
|
|||
}()
|
||||
|
||||
var (
|
||||
a oa.Annotation
|
||||
fV interface{}
|
||||
)
|
||||
|
||||
|
@ -188,13 +189,24 @@ func (r *InstanceRegistry) GetInstance(t reflect.Type) (instance interface{}, er
|
|||
return
|
||||
}
|
||||
|
||||
_, ok = as[annotation.InjectAnnotationType]
|
||||
a, ok = as[annotation.InjectAnnotationType]
|
||||
if ok {
|
||||
if fV, err = r.GetInstance(f.Type()); nil != err {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
a, ok = as[annotation.ResourceAnnotationType]
|
||||
if ok {
|
||||
name := a.(*annotation.ResourceAnnotation).Name
|
||||
if "" == name {
|
||||
name = n
|
||||
}
|
||||
if fV, err = r.GetInstanceByName(name); nil != err {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user