MCPcopy Index your code
hub / github.com/docker/cli / Set

Method Set

opts/opts.go:304–318  ·  view source on GitHub ↗

Set sets the value of the opt by parsing the command line value

(value string)

Source from the content-addressed store, hash-verified

302
303// Set sets the value of the opt by parsing the command line value
304func (o *FilterOpt) Set(value string) error {
305 if value == "" {
306 return nil
307 }
308 if !strings.Contains(value, "=") {
309 return errors.New("bad format of filter (expected name=value)")
310 }
311 name, val, _ := strings.Cut(value, "=")
312
313 // TODO(thaJeztah): these options should not be case-insensitive.
314 name = strings.ToLower(strings.TrimSpace(name))
315 val = strings.TrimSpace(val)
316 o.filter.Add(name, val)
317 return nil
318}
319
320// Type returns the option type
321func (*FilterOpt) Type() string {

Callers 2

TestCreateFilterFunction · 0.95

Calls 1

ContainsMethod · 0.80

Tested by 2

TestCreateFilterFunction · 0.76