On Wed, Jul 8, 2020 at 9:37 AM Bob Glickstein <bob.glickst...@gmail.com>
wrote:

> I've been able to make ThisOperationDoesNotExist work by faking up a
> FileDescriptorSet, like this:
>

Copy-paste error in my original message, sorry. It should be:


> descProtos := []*descriptorpb.DescriptorProto{&descProto}
> name := "x"
> fdProtos := []*descriptorpb.FileDescriptorProto{{Name: &name, MessageType:
> descProtos}}
> fdSet := &descriptorpb.FileDescriptorSet{File: fdProtos}
> f, err := protodesc.NewFiles(fdSet)
> var desc protoreflect.MessageDescriptor
> f.RangeFiles(func(fileDesc protoreflect.FileDescriptor) bool {
>   msgDescs := fileDesc.Messages()
>   desc = msgDescs.Get(0)
> })
>

Cheers,
- Bob

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CAEf8c49Auy3gSqkegmxdmESadJVGt6NoYdvAjeW9WJ%3DkNxs%3DPQ%40mail.gmail.com.

Reply via email to