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

Function parseBool

cli/command/context/options.go:65–79  ·  view source on GitHub ↗
(config map[string]string, name string)

Source from the content-addressed store, hash-verified

63)
64
65func parseBool(config map[string]string, name string) (bool, error) {
66 strVal, ok := config[name]
67 if !ok {
68 return false, nil
69 }
70 res, err := strconv.ParseBool(strVal)
71 if err != nil {
72 var nErr *strconv.NumError
73 if errors.As(err, &nErr) {
74 return res, fmt.Errorf("%s: parsing %q: %w", name, nErr.Num, nErr.Err)
75 }
76 return res, fmt.Errorf("%s: %w", name, err)
77 }
78 return res, nil
79}
80
81func validateConfig(config map[string]string, allowedKeys map[string]struct{}) error {
82 var errs []error

Callers 1

getDockerEndpointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…