MethodAnnotationPrefix added
This commit is contained in:
parent
ef45ff4ad6
commit
430e8dc498
|
@ -10,6 +10,8 @@ const (
|
|||
NameTag = "@name"
|
||||
DefaultTag = "@default"
|
||||
RequiredTag = "@required"
|
||||
|
||||
MethodAnnotationPrefix = "_"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -212,7 +212,11 @@ LOOP:
|
|||
if 0 == len(td.methodAnnotation) {
|
||||
td.methodAnnotation = make(map[string]map[reflect.Type]Annotation, 0)
|
||||
}
|
||||
td.methodAnnotation[f.Name] = as
|
||||
_name := strings.TrimLeft(f.Name, MethodAnnotationPrefix)
|
||||
if "" == _name {
|
||||
return nil, fmt.Errorf("name[%s] of method annotation is not valid", _name)
|
||||
}
|
||||
td.methodAnnotation[_name] = as
|
||||
continue LOOP
|
||||
} else {
|
||||
as, err := r.getAnnotation(&f)
|
||||
|
|
Loading…
Reference in New Issue
Block a user