()
| 808 | } |
| 809 | |
| 810 | func (m *testNestedMsg) Size() int { |
| 811 | if m == nil { |
| 812 | return 0 |
| 813 | } |
| 814 | var ( |
| 815 | sz = 0 |
| 816 | l int |
| 817 | ) |
| 818 | if m.Name != nil { |
| 819 | l = len(*m.Name) |
| 820 | sz += 1 + csproto.SizeOfVarint(uint64(l)) + l |
| 821 | } |
| 822 | if m.Value != nil { |
| 823 | sz += 1 + csproto.SizeOfVarint(uint64(*m.Value)) |
| 824 | } |
| 825 | return sz |
| 826 | } |
| 827 | |
| 828 | func (m *testNestedMsg) MarshalTo(dest []byte) error { |
| 829 | enc := csproto.NewEncoder(dest) |
no test coverage detected