(path string, textfmt bool)
| 1227 | } |
| 1228 | |
| 1229 | func loadFileDescriptorSet(path string, textfmt bool) (*descpb.FileDescriptorSet, error) { |
| 1230 | data, err := os.ReadFile(path) |
| 1231 | if err != nil { |
| 1232 | return nil, err |
| 1233 | } |
| 1234 | |
| 1235 | var fds descpb.FileDescriptorSet |
| 1236 | |
| 1237 | if textfmt { |
| 1238 | err = prototext.Unmarshal(data, &fds) |
| 1239 | } else { |
| 1240 | // binary pb |
| 1241 | err = proto.Unmarshal(data, &fds) |
| 1242 | } |
| 1243 | if err != nil { |
| 1244 | return nil, err |
| 1245 | } |
| 1246 | |
| 1247 | return &fds, nil |
| 1248 | } |
| 1249 | |
| 1250 | func deps(d protoreflect.FileDescriptor) []*descpb.FileDescriptorProto { |
| 1251 | var descriptorProtos []*descpb.FileDescriptorProto |
no outgoing calls
no test coverage detected