MCPcopy Create free account
hub / github.com/google/go-cmp / normalizeOption

Function normalizeOption

cmp/options.go:527–536  ·  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

525// are flattened and groups with a single element are reduced to that element.
526// Only coreOptions and Options containing coreOptions are allowed.
527func normalizeOption(src Option) Option {
528 switch opts := flattenOptions(nil, Options{src}); len(opts) {
529 case 0:
530 return nil
531 case 1:
532 return opts[0]
533 default:
534 return opts
535 }
536}
537
538// flattenOptions copies all options in src to dst as a flat list.
539// 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