MCPcopy Create free account
hub / github.com/docker/cli / NewMapOpts

Function NewMapOpts

opts/opts.go:166–174  ·  view source on GitHub ↗

NewMapOpts creates a new MapOpts with the specified map of values and a validator.

(values map[string]string, validator ValidatorFctType)

Source from the content-addressed store, hash-verified

164
165// NewMapOpts creates a new MapOpts with the specified map of values and a validator.
166func NewMapOpts(values map[string]string, validator ValidatorFctType) *MapOpts {
167 if values == nil {
168 values = make(map[string]string)
169 }
170 return &MapOpts{
171 values: values,
172 validator: validator,
173 }
174}
175
176// ValidatorFctType defines a validator function that returns a validated string and/or an error.
177type ValidatorFctType func(val string) (string, error)

Callers 1

TestMapOptsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestMapOptsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…