| 519 | } |
| 520 | |
| 521 | func fileDescriptorSet(path string) (*descpb.FileDescriptorSet, error) { |
| 522 | bytes, err := os.ReadFile(path) |
| 523 | if err != nil { |
| 524 | return nil, fmt.Errorf("failed to read file descriptor set file %q: %v", fileDescriptorSetPath, err) |
| 525 | } |
| 526 | fds := &descpb.FileDescriptorSet{} |
| 527 | if err := proto.Unmarshal(bytes, fds); err != nil { |
| 528 | return nil, fmt.Errorf("failed to unmarshal file descriptor set file %q: %v", fileDescriptorSetPath, err) |
| 529 | } |
| 530 | return fds, nil |
| 531 | } |
| 532 | |
| 533 | // PartialEvalProgramOption returns a TestRunnerOption which enables partial evaluation for the CEL |
| 534 | // program by setting the OptPartialEval eval option. |