MCPcopy
hub / github.com/cli/cli / ValidateKey

Function ValidateKey

pkg/cmd/config/set/set.go:90–98  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

88}
89
90func ValidateKey(key string) error {
91 for _, configKey := range config.Options {
92 if key == configKey.Key {
93 return nil
94 }
95 }
96
97 return fmt.Errorf("invalid key")
98}
99
100type InvalidValueError struct {
101 ValidValues []string

Callers 2

setRunFunction · 0.85
Test_ValidateKeyFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by 1

Test_ValidateKeyFunction · 0.68