(key string, iMap map[string]interface{}, v *InterfaceMapValidation)
| 47 | } |
| 48 | |
| 49 | func InterfaceMapFromInterfaceMap(key string, iMap map[string]interface{}, v *InterfaceMapValidation) (map[string]interface{}, error) { |
| 50 | inter, ok := ReadInterfaceMapValue(key, iMap) |
| 51 | if !ok { |
| 52 | val, err := ValidateInterfaceMapMissing(v) |
| 53 | if err != nil { |
| 54 | return nil, errors.Wrap(err, key) |
| 55 | } |
| 56 | return val, nil |
| 57 | } |
| 58 | val, err := InterfaceMap(inter, v) |
| 59 | if err != nil { |
| 60 | return nil, errors.Wrap(err, key) |
| 61 | } |
| 62 | return val, nil |
| 63 | } |
| 64 | |
| 65 | func ValidateInterfaceMapMissing(v *InterfaceMapValidation) (map[string]interface{}, error) { |
| 66 | if v.Required { |
no test coverage detected