Esempio n. 1
0
func RWTestGoToCapn(seg *capn.Segment, src *RWTest) air.RWTestCapn {
	dest := air.AutoNewRWTestCapn(seg)

	// NestMatrix -> Nester1Capn (go slice to capn list)
	if len(src.NestMatrix) > 0 {
		//typedList := air.NewNester1CapnList(seg, len(src.NestMatrix))
		plist := seg.NewPointerList(len(src.NestMatrix))
		i := 0
		for _, ele := range src.NestMatrix {
			//plist.Set(i, capn.Object(Nester1GoToCapn(seg, &ele)))
			r := capn.Object(SliceNester1ToNester1CapnList(seg, ele))
			plist.Set(i, r)
			i++
		}
		//dest.SetNestMatrix(typedList)
		dest.SetNestMatrix(plist)
	}

	return dest
}