mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 05:08:14 +00:00
encoding/cbor: ignore struct fields with cbor:"-"
This commit is contained in:
@@ -650,6 +650,10 @@ _unmarshal_map :: proc(d: Decoder, v: any, ti: ^reflect.Type_Info, hdr: Header,
|
||||
{
|
||||
for field, field_idx in fields {
|
||||
tag_value := string(reflect.struct_tag_get(field.tag, "cbor"))
|
||||
if tag_value == "-" {
|
||||
continue
|
||||
}
|
||||
|
||||
if key == tag_value {
|
||||
use_field_idx = field_idx
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user