(config map[string]string, name string)
| 63 | ) |
| 64 | |
| 65 | func 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 | |
| 81 | func validateConfig(config map[string]string, allowedKeys map[string]struct{}) error { |
| 82 | var errs []error |
no outgoing calls
no test coverage detected
searching dependent graphs…