修复字段名解析对于omit的处理
This commit is contained in:
@ -34,7 +34,9 @@ func (psf parseStructField) GetParamName(structField reflect.StructField) string
|
||||
}
|
||||
for _, tag := range paramNameTagList {
|
||||
tagVal := structField.Tag.Get(tag)
|
||||
if tagVal != "" {
|
||||
tagVal = strings.TrimSuffix(strings.TrimPrefix(tagVal, define.TagNameOmitempty+","), ","+define.TagNameOmitempty)
|
||||
tagVal = strings.Trim(tagVal, ",")
|
||||
if tagVal != "" && tagVal != define.TagNameOmitempty {
|
||||
return tagVal
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user