normalizeOption normalizes the input options such that all Options groups are flattened and groups with a single element are reduced to that element. Only coreOptions and Options containing coreOptions are allowed.
(src Option)
| 533 | // are flattened and groups with a single element are reduced to that element. |
| 534 | // Only coreOptions and Options containing coreOptions are allowed. |
| 535 | func normalizeOption(src Option) Option { |
| 536 | switch opts := flattenOptions(nil, Options{src}); len(opts) { |
| 537 | case 0: |
| 538 | return nil |
| 539 | case 1: |
| 540 | return opts[0] |
| 541 | default: |
| 542 | return opts |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | // flattenOptions copies all options in src to dst as a flat list. |
| 547 | // Only coreOptions and Options containing coreOptions are allowed. |
no test coverage detected
searching dependent graphs…