(buf []byte, m Message, deterministic bool)
| 30 | var zeroBytes = make([]byte, 0, 0) |
| 31 | |
| 32 | func marshalAppend(buf []byte, m Message, deterministic bool) ([]byte, error) { |
| 33 | if m == nil { |
| 34 | return nil, ErrNil |
| 35 | } |
| 36 | mi := MessageV2(m) |
| 37 | nbuf, err := protoV2.MarshalOptions{ |
| 38 | Deterministic: deterministic, |
| 39 | AllowPartial: true, |
| 40 | }.MarshalAppend(buf, mi) |
| 41 | if err != nil { |
| 42 | return buf, err |
| 43 | } |
| 44 | if len(buf) == len(nbuf) { |
| 45 | if !mi.ProtoReflect().IsValid() { |
| 46 | return buf, ErrNil |
| 47 | } |
| 48 | } |
| 49 | return nbuf, checkRequiredNotSet(mi) |
| 50 | } |
| 51 | |
| 52 | // Unmarshal parses a wire-format message in b and places the decoded results in m. |
| 53 | // |
no test coverage detected