(cctagsPathStr string, cctagsPath []int16, v reflect.Value, name string, idx **[]int)
| 601 | } |
| 602 | |
| 603 | func (dec *Decoder) tryToAddNewTag(cctagsPathStr string, cctagsPath []int16, v reflect.Value, name string, idx **[]int) { |
| 604 | dec.state.lock.Lock() |
| 605 | defer dec.state.lock.Unlock() |
| 606 | if *idx == nil { |
| 607 | *idx = dec.ctagsCache.FindOrAdd(cctagsPath) |
| 608 | } |
| 609 | if len(**idx) == 0 { |
| 610 | if sf, ok := fieldByTag(v.Type(), name); ok { |
| 611 | **idx = sf.Index |
| 612 | } else { |
| 613 | // Add tags path to the missing fields cache to avoid unique lock for those fields later |
| 614 | dec.ctagsCache.missing[cctagsPathStr] = struct{}{} |
| 615 | } |
| 616 | } |
| 617 | } |
| 618 | |
| 619 | func (dec *Decoder) ResetSerializer() { |
| 620 | if dec.ser == nil { |
no test coverage detected