(f *codecFnInfo, rv reflect.Value)
| 502 | } |
| 503 | |
| 504 | func (e *Encoder) kStructNoOmitempty(f *codecFnInfo, rv reflect.Value) { |
| 505 | var tisfi []*structFieldInfo |
| 506 | if f.ti.toArray || e.h.StructToArray { // toArray |
| 507 | tisfi = f.ti.sfi.source() |
| 508 | e.arrayStart(len(tisfi)) |
| 509 | for _, si := range tisfi { |
| 510 | e.arrayElem() |
| 511 | e.encodeValue(si.path.field(rv), nil) |
| 512 | } |
| 513 | e.arrayEnd() |
| 514 | } else { |
| 515 | tisfi = e.kStructSfi(f) |
| 516 | e.mapStart(len(tisfi)) |
| 517 | keytyp := f.ti.keyType |
| 518 | for _, si := range tisfi { |
| 519 | e.mapElemKey() |
| 520 | e.kStructFieldKey(keytyp, si.path.encNameAsciiAlphaNum, si.encName) |
| 521 | e.mapElemValue() |
| 522 | e.encodeValue(si.path.field(rv), nil) |
| 523 | } |
| 524 | e.mapEnd() |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | func (e *Encoder) kStructFieldKey(keyType valueType, encNameAsciiAlphaNum bool, encName string) { |
| 529 | encStructFieldKey(encName, e.e, e.w(), keyType, encNameAsciiAlphaNum, e.js) |
nothing calls this directly
no test coverage detected