WithModuleFormat attaches the given format as a module format. It is up to the user to not incorrectly attach a format twice.
(format string, options ...ModuleFormatOption)
| 663 | // |
| 664 | // It is up to the user to not incorrectly attach a format twice. |
| 665 | func WithModuleFormat(format string, options ...ModuleFormatOption) RefParserOption { |
| 666 | return func(refParser *refParser) { |
| 667 | format = normalizeFormat(format) |
| 668 | if format == "" { |
| 669 | return |
| 670 | } |
| 671 | moduleFormatInfo := newModuleFormatInfo() |
| 672 | for _, option := range options { |
| 673 | option(moduleFormatInfo) |
| 674 | } |
| 675 | refParser.moduleFormatToInfo[format] = moduleFormatInfo |
| 676 | } |
| 677 | } |
| 678 | |
| 679 | // WithProtoFileFormat attaches the given format as a single file format. |
| 680 | // |
no test coverage detected
searching dependent graphs…