ing
This commit is contained in:
parent
219bb2f0c9
commit
64af0e5f73
|
@ -1,8 +1,11 @@
|
|||
package annotation
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"git.loafle.net/commons_go/logging"
|
||||
|
||||
cdur "git.loafle.net/commons_go/di/util/reflect"
|
||||
)
|
||||
|
||||
|
@ -13,6 +16,10 @@ func init() {
|
|||
}
|
||||
|
||||
func RegisterAnnotation(name string, t reflect.Type) {
|
||||
if _, ok := annotationRegistry[name]; ok {
|
||||
logging.Logger().Panic(fmt.Sprintf("DI: name[%s] of annotation exist already.", name))
|
||||
}
|
||||
|
||||
meta := getMetaFields(t)
|
||||
fRT, _, _ := cdur.GetTypeInfo(t)
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package registry
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
@ -50,7 +49,7 @@ func RegisterType(t reflect.Type) {
|
|||
pc, _, _, ok := runtime.Caller(1)
|
||||
details := runtime.FuncForPC(pc)
|
||||
if ok && details != nil {
|
||||
log.Printf("called from %s\n", details.Name())
|
||||
logging.Logger().Debug(fmt.Sprintf("called from %s", details.Name()))
|
||||
}
|
||||
|
||||
registry.RegisterType(t)
|
||||
|
|
Loading…
Reference in New Issue
Block a user