Remove extra flags from tagnames

This commit is contained in:
Nise Void 2019-01-23 14:11:04 +01:00
parent 5778878a2a
commit 6a3a02677f
Signed by: NiseVoid
GPG Key ID: FBA14AC83EA602F3
1 changed files with 4 additions and 0 deletions

View File

@ -39,7 +39,11 @@ func (f Fields) ToString(tag string) string {
var name string
if tag != `` {
name = v.Field.Tag.Get(tag)
if idx := strings.IndexRune(name, ','); idx != -1 {
name = name[:idx]
}
}
if name == `` {
name = v.Field.Name
}