MCPcopy
hub / github.com/google/go-cmp / normalizeOption

Function normalizeOption

cmp/options.go:535–544  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

533// are flattened and groups with a single element are reduced to that element.
534// Only coreOptions and Options containing coreOptions are allowed.
535func 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.

Callers 2

FilterPathFunction · 0.85
FilterValuesFunction · 0.85

Calls 1

flattenOptionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…