mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 18:29:23 +02:00
fix(serialization): correctly handle json tag
This commit is contained in:
@@ -211,6 +211,10 @@ func initTypeKeyFieldIndexesMap(t reflect.Type) typeInfo {
|
||||
deserializeTag := field.Tag.Get(tagDeserialize)
|
||||
jsonTag := field.Tag.Get(tagJSON)
|
||||
|
||||
if jsonTag != "" {
|
||||
jsonTag, _, _ = strings.Cut(jsonTag, ",")
|
||||
}
|
||||
|
||||
if deserializeTag == "-" || jsonTag == "-" {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user