forked from Fuyu/validate
Remove extra flags from tagnames
This commit is contained in:
parent
5778878a2a
commit
6a3a02677f
@ -39,7 +39,11 @@ func (f Fields) ToString(tag string) string {
|
|||||||
var name string
|
var name string
|
||||||
if tag != `` {
|
if tag != `` {
|
||||||
name = v.Field.Tag.Get(tag)
|
name = v.Field.Tag.Get(tag)
|
||||||
|
if idx := strings.IndexRune(name, ','); idx != -1 {
|
||||||
|
name = name[:idx]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if name == `` {
|
if name == `` {
|
||||||
name = v.Field.Name
|
name = v.Field.Name
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user