Closed residual-paranoia closed 1 year ago
@residual-paranoia, yes, you can load the descriptors generated by protoc: https://pkg.go.dev/github.com/jhump/protoreflect/desc#CreateFileDescriptorsFromSet
First you'll unmarshal the file into a *descriptorpb.FileDescriptorSet
(since the file contents are the binary encoding of this type). Then you can use the method above to process that into desc.FileDescriptor
objects.
example:protoc -I$GOPATH/src -I. --include_imports --include_source_info --descriptor_set_out=testdesc.pb testdesc.proto. Can load testdesc.pb file to generate FileDescriptor.