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

Method Set

opts/opts.go:138–149  ·  view source on GitHub ↗

Set validates if needed the input value and add it to the internal map, by splitting on '='.

(value string)

Source from the content-addressed store, hash-verified

136// Set validates if needed the input value and add it to the
137// internal map, by splitting on '='.
138func (opts *MapOpts) Set(value string) error {
139 if opts.validator != nil {
140 v, err := opts.validator(value)
141 if err != nil {
142 return err
143 }
144 value = v
145 }
146 k, v, _ := strings.Cut(value, "=")
147 opts.values[k] = v
148 return nil
149}
150
151// GetAll returns the values of MapOpts as a map.
152func (opts *MapOpts) GetAll() map[string]string {

Callers 7

TestMapOptsFunction · 0.95
postFormFunction · 0.45
GetAutoPATMethod · 0.45
AuthorizeRequestMethod · 0.45
TestMountOptErrorsFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by 3

TestMapOptsFunction · 0.76
TestMountOptErrorsFunction · 0.36