ValidateBundleArguments checks if all strings in slice 'a' are keys in map 'b'.
(a []string, b map[string]string)
| 235 | |
| 236 | // ValidateBundleArguments checks if all strings in slice 'a' are keys in map 'b'. |
| 237 | func 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 | } |
no test coverage detected