MCPcopy
hub / github.com/golang/protobuf / MessageRawDescriptor

Function MessageRawDescriptor

descriptor/descriptor.go:111–117  ·  view source on GitHub ↗

MessageRawDescriptor returns the GZIP'd raw file descriptor representing the message and the index path to reach the message declaration. The returned slices must not be mutated.

(m proto.GeneratedMessage)

Source from the content-addressed store, hash-verified

109// the message and the index path to reach the message declaration.
110// The returned slices must not be mutated.
111func MessageRawDescriptor(m proto.GeneratedMessage) ([]byte, []int) {
112 if mv, ok := m.(interface{ Descriptor() ([]byte, []int) }); ok {
113 return mv.Descriptor()
114 }
115 md := protoimpl.X.MessageTypeOf(m)
116 return deriveRawDescriptor(md.Descriptor())
117}
118
119var fileDescCache sync.Map // map[*byte]*descriptorpb.FileDescriptorProto
120

Callers 2

TestMessageDescriptorFunction · 0.85
MessageDescriptorProtoFunction · 0.85

Calls 2

deriveRawDescriptorFunction · 0.85
DescriptorMethod · 0.65

Tested by 1

TestMessageDescriptorFunction · 0.68