WithSingleFormat attaches the given format as a single format. It is up to the user to not incorrectly attached a format twice.
(format string, options ...SingleFormatOption)
| 595 | // |
| 596 | // It is up to the user to not incorrectly attached a format twice. |
| 597 | func WithSingleFormat(format string, options ...SingleFormatOption) RefParserOption { |
| 598 | return func(refParser *refParser) { |
| 599 | format = normalizeFormat(format) |
| 600 | if format == "" { |
| 601 | return |
| 602 | } |
| 603 | singleFormatInfo := newSingleFormatInfo() |
| 604 | for _, option := range options { |
| 605 | option(singleFormatInfo) |
| 606 | } |
| 607 | refParser.singleFormatToInfo[format] = singleFormatInfo |
| 608 | } |
| 609 | } |
| 610 | |
| 611 | // WithArchiveFormat attaches the given format as an archive format. |
| 612 | // |
no test coverage detected
searching dependent graphs…