MCPcopy Index your code
hub / github.com/cortexlabs/cortex / ValidateStringMapProvided

Function ValidateStringMapProvided

pkg/lib/configreader/string_map.go:67–76  ·  view source on GitHub ↗
(val map[string]string, v *StringMapValidation)

Source from the content-addressed store, hash-verified

65}
66
67func ValidateStringMapProvided(val map[string]string, v *StringMapValidation) (map[string]string, error) {
68 if v.CantBeSpecifiedErrStr != nil {
69 return nil, ErrorFieldCantBeSpecified(*v.CantBeSpecifiedErrStr)
70 }
71
72 if !v.AllowExplicitNull && val == nil {
73 return nil, ErrorCannotBeNull(v.Required)
74 }
75 return validateStringMap(val, v)
76}
77
78func validateStringMap(val map[string]string, v *StringMapValidation) (map[string]string, error) {
79 if !v.AllowEmpty {

Callers 1

StringMapFunction · 0.85

Calls 3

ErrorCannotBeNullFunction · 0.85
validateStringMapFunction · 0.85

Tested by

no test coverage detected