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

Method ProtoMessageV2Of

internal/impl/api_export.go:127–135  ·  view source on GitHub ↗

ProtoMessageV2Of converts either a v1 or v2 message to a v2 message. It returns nil if m is nil.

(m message)

Source from the content-addressed store, hash-verified

125// ProtoMessageV2Of converts either a v1 or v2 message to a v2 message.
126// It returns nil if m is nil.
127func (Export) ProtoMessageV2Of(m message) protoreflect.ProtoMessage {
128 if m == nil {
129 return nil
130 }
131 if mv := (Export{}).protoMessageV2Of(m); mv != nil {
132 return mv
133 }
134 return legacyWrapMessage(reflect.ValueOf(m)).Interface()
135}
136
137// MessageOf returns the protoreflect.Message interface over m.
138// It returns nil if m is nil.

Callers 7

initFunction · 0.80
TestFunction · 0.80
nullable_test.goFile · 0.80
StringMethod · 0.80
StringMethod · 0.80
StringMethod · 0.80
MessageV2OfFunction · 0.80

Calls 4

legacyWrapMessageFunction · 0.85
protoMessageV2OfMethod · 0.80
InterfaceMethod · 0.65
ValueOfMethod · 0.65

Tested by 2

initFunction · 0.64
TestFunction · 0.64