MCPcopy Create free account
hub / github.com/Permify/permify / ValidateBundleArguments

Function ValidateBundleArguments

internal/validation/validation.go:237–248  ·  view source on GitHub ↗

ValidateBundleArguments checks if all strings in slice 'a' are keys in map 'b'.

(a []string, b map[string]string)

Source from the content-addressed store, hash-verified

235
236// ValidateBundleArguments checks if all strings in slice 'a' are keys in map 'b'.
237func ValidateBundleArguments(a []string, b map[string]string) error {
238 // Iterate through each string in slice 'a'.
239 for _, str := range a {
240 // Check if the current string is a key in map 'b'.
241 if _, exists := b[str]; !exists {
242 // If the string is not a key in the map, return an error.
243 return errors.New(base.ErrorCode_ERROR_CODE_MISSING_ARGUMENT.String())
244 }
245 }
246 // If all strings in 'a' are keys in 'b', return nil indicating success.
247 return nil
248}

Callers 2

RunBundleMethod · 0.92
validation_test.goFile · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected