bug fix
This commit is contained in:
parent
eca6c94b5f
commit
013ceb12bb
15
Gopkg.lock
generated
15
Gopkg.lock
generated
|
@ -1,15 +0,0 @@
|
||||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
|
||||||
|
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
name = "git.loafle.net/commons/util-go"
|
|
||||||
packages = ["reflect"]
|
|
||||||
revision = "1966a985759721fd451171a78a0b8f4524afc644"
|
|
||||||
|
|
||||||
[solve-meta]
|
|
||||||
analyzer-name = "dep"
|
|
||||||
analyzer-version = 1
|
|
||||||
inputs-digest = "a9ccea72cbcb32a9e2adaa190e9414c4d42e55920e7543a5d3a5db9f6c77b880"
|
|
||||||
solver-name = "gps-cdcl"
|
|
||||||
solver-version = 1
|
|
34
Gopkg.toml
34
Gopkg.toml
|
@ -1,34 +0,0 @@
|
||||||
# Gopkg.toml example
|
|
||||||
#
|
|
||||||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
|
|
||||||
# for detailed Gopkg.toml documentation.
|
|
||||||
#
|
|
||||||
# required = ["github.com/user/thing/cmd/thing"]
|
|
||||||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
|
|
||||||
#
|
|
||||||
# [[constraint]]
|
|
||||||
# name = "github.com/user/project"
|
|
||||||
# version = "1.0.0"
|
|
||||||
#
|
|
||||||
# [[constraint]]
|
|
||||||
# name = "github.com/user/project2"
|
|
||||||
# branch = "dev"
|
|
||||||
# source = "github.com/myfork/project2"
|
|
||||||
#
|
|
||||||
# [[override]]
|
|
||||||
# name = "github.com/x/y"
|
|
||||||
# version = "2.4.0"
|
|
||||||
#
|
|
||||||
# [prune]
|
|
||||||
# non-go = false
|
|
||||||
# go-tests = true
|
|
||||||
# unused-packages = true
|
|
||||||
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
branch = "master"
|
|
||||||
name = "git.loafle.net/commons/util-go"
|
|
||||||
|
|
||||||
[prune]
|
|
||||||
go-tests = true
|
|
||||||
unused-packages = true
|
|
5
go.mod
Normal file
5
go.mod
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
module git.loafle.net/commons/di-go
|
||||||
|
|
||||||
|
go 1.12
|
||||||
|
|
||||||
|
require git.loafle.net/commons/util-go v0.0.0-20180823073240-bf5ffd1c385d
|
2
go.sum
Normal file
2
go.sum
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
git.loafle.net/commons/util-go v0.0.0-20180823073240-bf5ffd1c385d h1:OU8uK1BTFkWzsYJTP3Fc0P5c24mx3yTsRAkBZxQCFRU=
|
||||||
|
git.loafle.net/commons/util-go v0.0.0-20180823073240-bf5ffd1c385d/go.mod h1:/usq9jsy3wiGHPoYBPn+XGew2eqo+IFc5KYaR84x4Q0=
|
|
@ -201,7 +201,18 @@ func (cr *defaultComponentRegistry) GetInstanceByName(name string) (interface{},
|
||||||
if ok {
|
if ok {
|
||||||
return v, nil
|
return v, nil
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("DI: Resource[%s] is not exist", name)
|
|
||||||
|
td, ok := cr.definitionByName[name]
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("DI: Instance[%s] is not exist", name)
|
||||||
|
}
|
||||||
|
|
||||||
|
v, err := cr.GetInstance(td.Type)
|
||||||
|
if nil != err {
|
||||||
|
return nil, fmt.Errorf("DI: Instance[%s] is not exist -> %s", name, err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
return v, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetInstances returns instance of annotated
|
// GetInstances returns instance of annotated
|
||||||
|
|
Loading…
Reference in New Issue
Block a user