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

Method MessageOf

internal/impl/api_export.go:139–147  ·  view source on GitHub ↗

MessageOf returns the protoreflect.Message interface over m. It returns nil if m is nil.

(m message)

Source from the content-addressed store, hash-verified

137// MessageOf returns the protoreflect.Message interface over m.
138// It returns nil if m is nil.
139func (Export) MessageOf(m message) protoreflect.Message {
140 if m == nil {
141 return nil
142 }
143 if mv := (Export{}).protoMessageV2Of(m); mv != nil {
144 return mv.ProtoReflect()
145 }
146 return legacyWrapMessage(reflect.ValueOf(m))
147}
148
149// MessageDescriptorOf returns the protoreflect.MessageDescriptor for m.
150// It returns nil if m is nil.

Callers 15

ProtoReflectMethod · 0.45
ProtoReflectMethod · 0.45
ProtoReflectMethod · 0.45
ProtoReflectMethod · 0.45
ProtoReflectMethod · 0.45
ProtoReflectMethod · 0.45
ProtoReflectMethod · 0.45
ProtoReflectMethod · 0.45
ProtoReflectMethod · 0.45
ProtoReflectMethod · 0.45
ProtoReflectMethod · 0.45
ProtoReflectMethod · 0.45

Calls 4

legacyWrapMessageFunction · 0.85
protoMessageV2OfMethod · 0.80
ProtoReflectMethod · 0.65
ValueOfMethod · 0.65

Tested by 15

TestLegacyMarshalMethodFunction · 0.36
TestLegacyMergeMethodFunction · 0.36
TestExtensionFuncsFunction · 0.36
ProtoReflectMethod · 0.36
ProtoReflectMethod · 0.36
ProtoReflectMethod · 0.36
ProtoReflectMethod · 0.36
ProtoReflectMethod · 0.36
ProtoReflectMethod · 0.36