MCPcopy
hub / github.com/ugorji/go / CodecEncodeSelf

Method CodecEncodeSelf

codec/values_codecgen_generated_test.go:504–973  ·  view source on GitHub ↗
(e *Encoder)

Source from the content-addressed store, hash-verified

502
503func (AnonInTestStruc) codecSelferViaCodecgen() {}
504func (x *AnonInTestStruc) CodecEncodeSelf(e *Encoder) {
505 var h codecSelfer19780
506 z, r := GenHelper().Encoder(e)
507 _, _, _ = h, z, r
508 if z.EncBasicHandle().CheckCircularRef {
509 z.EncEncode(x)
510 return
511 }
512 if x == nil {
513 r.EncodeNil()
514 } else {
515 yy2arr2 := z.EncBasicHandle().StructToArray
516 _ = yy2arr2
517 const yyr2 bool = false // struct tag has 'toArray'
518 if yyr2 || yy2arr2 {
519 z.EncWriteArrayStart(17)
520 z.EncWriteArrayElem()
521 r.EncodeString(string(x.AS))
522 z.EncWriteArrayElem()
523 r.EncodeInt(int64(x.AI64))
524 z.EncWriteArrayElem()
525 r.EncodeInt(int64(x.AI16))
526 z.EncWriteArrayElem()
527 r.EncodeUint(uint64(x.AUi64))
528 z.EncWriteArrayElem()
529 if x.ASslice == nil {
530 r.EncodeNil()
531 } else {
532 z.F.EncSliceStringV(x.ASslice, e)
533 } // end block: if x.ASslice slice == nil
534 z.EncWriteArrayElem()
535 if x.AI64slice == nil {
536 r.EncodeNil()
537 } else {
538 z.F.EncSliceInt64V(x.AI64slice, e)
539 } // end block: if x.AI64slice slice == nil
540 z.EncWriteArrayElem()
541 if x.AUi64slice == nil {
542 r.EncodeNil()
543 } else {
544 z.F.EncSliceUint64V(x.AUi64slice, e)
545 } // end block: if x.AUi64slice slice == nil
546 z.EncWriteArrayElem()
547 if x.AF64slice == nil {
548 r.EncodeNil()
549 } else {
550 z.F.EncSliceFloat64V(x.AF64slice, e)
551 } // end block: if x.AF64slice slice == nil
552 z.EncWriteArrayElem()
553 if x.AF32slice == nil {
554 r.EncodeNil()
555 } else {
556 z.F.EncSliceFloat32V(x.AF32slice, e)
557 } // end block: if x.AF32slice slice == nil
558 z.EncWriteArrayElem()
559 if x.AMSS == nil {
560 r.EncodeNil()
561 } else {

Callers

nothing calls this directly

Calls 15

encArray8int64Method · 0.95
encArray0int64Method · 0.95
GenHelperFunction · 0.85
EncoderMethod · 0.80
EncBasicHandleMethod · 0.80
EncEncodeMethod · 0.80
EncWriteArrayStartMethod · 0.80
EncWriteArrayElemMethod · 0.80
EncSliceStringVMethod · 0.80
EncSliceInt64VMethod · 0.80
EncSliceUint64VMethod · 0.80
EncSliceFloat64VMethod · 0.80

Tested by

no test coverage detected