Reset clears every field in the message. The resulting message shares no observable memory with its previous state other than the memory for the message itself.
(m Message)
| 14 | // The resulting message shares no observable memory with its previous state |
| 15 | // other than the memory for the message itself. |
| 16 | func Reset(m Message) { |
| 17 | if mr, ok := m.(interface{ Reset() }); ok && hasProtoMethods { |
| 18 | mr.Reset() |
| 19 | return |
| 20 | } |
| 21 | resetMessage(m.ProtoReflect()) |
| 22 | } |
| 23 | |
| 24 | func resetMessage(m protoreflect.Message) { |
| 25 | if !m.IsValid() { |