MCPcopy Create free account
hub / github.com/devfile/api / newInvalidKeysError

Function newInvalidKeysError

pkg/validation/variables/errors.go:35–47  ·  view source on GitHub ↗

newInvalidKeysError processes the invalid key set and returns an InvalidKeysError if present

(keySet map[string]bool)

Source from the content-addressed store, hash-verified

33
34// newInvalidKeysError processes the invalid key set and returns an InvalidKeysError if present
35func newInvalidKeysError(keySet map[string]bool) error {
36 var invalidKeysArr []string
37 for key := range keySet {
38 invalidKeysArr = append(invalidKeysArr, key)
39 }
40
41 if len(invalidKeysArr) > 0 {
42 sort.Strings(invalidKeysArr)
43 return &InvalidKeysError{Keys: invalidKeysArr}
44 }
45
46 return nil
47}

Calls 1

StringsMethod · 0.80

Tested by 1

TestNewInvalidKeysErrorFunction · 0.68