WithProtoFileFormat attaches the given format as a single file format. It is up to the user to not incorrectly attach a format twice.
(format string, options ...ProtoFileFormatOption)
| 680 | // |
| 681 | // It is up to the user to not incorrectly attach a format twice. |
| 682 | func WithProtoFileFormat(format string, options ...ProtoFileFormatOption) RefParserOption { |
| 683 | return func(refParser *refParser) { |
| 684 | format = normalizeFormat(format) |
| 685 | if format == "" { |
| 686 | return |
| 687 | } |
| 688 | protoFileFormatInfo := newProtoFileFormatInfo() |
| 689 | for _, option := range options { |
| 690 | option(protoFileFormatInfo) |
| 691 | } |
| 692 | refParser.protoFileFormatToInfo[format] = protoFileFormatInfo |
| 693 | } |
| 694 | } |
| 695 | |
| 696 | // SingleFormatOption is a single format option. |
| 697 | type SingleFormatOption func(*singleFormatInfo) |
no test coverage detected
searching dependent graphs…