1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-06 05:50:19 +00:00

ignore case of tag and fixed bug for columName

This commit is contained in:
ysqi
2016-06-03 22:06:43 +08:00
parent 1fe2226c11
commit d528fafd43
3 changed files with 72 additions and 10 deletions

View File

@ -192,10 +192,10 @@ func parseStructTag(data string, attrs *map[string]bool, tags *map[string]string
tag := make(map[string]string)
for _, v := range strings.Split(data, defaultStructTagDelim) {
v = strings.TrimSpace(v)
if supportTag[v] == 1 {
attr[v] = true
if t := strings.ToLower(v); supportTag[t] == 1 {
attr[t] = true
} else if i := strings.Index(v, "("); i > 0 && strings.Index(v, ")") == len(v)-1 {
name := v[:i]
name := t[:i]
if supportTag[name] == 2 {
v = v[i+1 : len(v)-1]
tag[name] = v