marshalList marshals the given protoreflect.List as multiple name-value fields.
(name string, list protoreflect.List, fd protoreflect.FieldDescriptor)
| 266 | |
| 267 | // marshalList marshals the given protoreflect.List as multiple name-value fields. |
| 268 | func (e encoder) marshalList(name string, list protoreflect.List, fd protoreflect.FieldDescriptor) error { |
| 269 | size := list.Len() |
| 270 | for i := 0; i < size; i++ { |
| 271 | e.WriteName(name) |
| 272 | if err := e.marshalSingular(list.Get(i), fd); err != nil { |
| 273 | return err |
| 274 | } |
| 275 | } |
| 276 | return nil |
| 277 | } |
| 278 | |
| 279 | // marshalMap marshals the given protoreflect.Map as multiple name-value fields. |
| 280 | func (e encoder) marshalMap(name string, mmap protoreflect.Map, fd protoreflect.FieldDescriptor) error { |
no test coverage detected