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 untrusted user: NiseVoid
GPG Key ID: FBA14AC83EA602F3

View File

@ -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
} }