Size returns the size in bytes of the wire-format encoding of m. Note that Size might return more bytes than Marshal will write in the case of lazily decoded messages that arrive in non-minimal wire format: see https://protobuf.dev/reference/go/size/ for more details.
(m Message)
| 26 | // lazily decoded messages that arrive in non-minimal wire format: see |
| 27 | // https://protobuf.dev/reference/go/size/ for more details. |
| 28 | func (o MarshalOptions) Size(m Message) int { |
| 29 | // Treat a nil message interface as an empty message; nothing to output. |
| 30 | if m == nil { |
| 31 | return 0 |
| 32 | } |
| 33 | |
| 34 | return o.size(m.ProtoReflect()) |
| 35 | } |
| 36 | |
| 37 | // size is a centralized function that all size operations go through. |
| 38 | // For profiling purposes, avoid changing the name of this function or |
no test coverage detected