bencode: Use default field name if it isn't given (but options are)
This commit is contained in:
parent
644ee0a244
commit
ddf7cbbdac
|
@ -237,7 +237,9 @@ func encode_fields(t reflect.Type) []encode_field {
|
|||
continue
|
||||
}
|
||||
name, opts := parse_tag(tv)
|
||||
ef.tag = name
|
||||
if name != "" {
|
||||
ef.tag = name
|
||||
}
|
||||
ef.omit_empty = opts.contains("omitempty")
|
||||
}
|
||||
fs = append(fs, ef)
|
||||
|
|
Loading…
Reference in New Issue