MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / validate

Function validate

cli/pkg/ssh_config/validators.go:74–86  ·  view source on GitHub ↗
(key, val string)

Source from the content-addressed store, hash-verified

72}
73
74func validate(key, val string) error {
75 lkey := strings.ToLower(key)
76 if mustBeYesOrNo(lkey) && (val != "yes" && val != "no") {
77 return fmt.Errorf("ssh_config: value for key %q must be 'yes' or 'no', got %q", key, val)
78 }
79 if mustBeUint(lkey) {
80 _, err := strconv.ParseUint(val, 10, 64)
81 if err != nil {
82 return fmt.Errorf("ssh_config: %v", err)
83 }
84 }
85 return nil
86}
87
88var defaults = map[string]string{
89 strings.ToLower("AddKeysToAgent"): "no",

Callers 2

TestValidateFunction · 0.85
findValFunction · 0.85

Calls 2

mustBeYesOrNoFunction · 0.85
mustBeUintFunction · 0.85

Tested by 1

TestValidateFunction · 0.68