MCPcopy
hub / github.com/protocolbuffers/protobuf-go / Reset

Method Reset

internal/impl/message_reflect.go:411–420  ·  view source on GitHub ↗

Reset implements the v1 proto.Message.Reset method.

()

Source from the content-addressed store, hash-verified

409
410// Reset implements the v1 proto.Message.Reset method.
411func (m *messageIfaceWrapper) Reset() {
412 if mr, ok := m.protoUnwrap().(interface{ Reset() }); ok {
413 mr.Reset()
414 return
415 }
416 rv := reflect.ValueOf(m.protoUnwrap())
417 if rv.Kind() == reflect.Ptr && !rv.IsNil() {
418 rv.Elem().Set(reflect.Zero(rv.Type().Elem()))
419 }
420}
421func (m *messageIfaceWrapper) ProtoReflect() protoreflect.Message {
422 return (*messageReflectWrapper)(m)
423}

Callers

nothing calls this directly

Calls 9

protoUnwrapMethod · 0.95
IsNilMethod · 0.80
ElemMethod · 0.80
ResetMethod · 0.65
ValueOfMethod · 0.65
KindMethod · 0.65
SetMethod · 0.65
ZeroMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected