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

Function ValidateInterfaceProvided

pkg/lib/configreader/interface.go:66–75  ·  view source on GitHub ↗
(val interface{}, v *InterfaceValidation)

Source from the content-addressed store, hash-verified

64}
65
66func ValidateInterfaceProvided(val interface{}, v *InterfaceValidation) (interface{}, error) {
67 if v.CantBeSpecifiedErrStr != nil {
68 return nil, ErrorFieldCantBeSpecified(*v.CantBeSpecifiedErrStr)
69 }
70
71 if !v.AllowExplicitNull && val == nil {
72 return nil, ErrorCannotBeNull(v.Required)
73 }
74 return validateInterface(val, v)
75}
76
77func validateInterface(val interface{}, v *InterfaceValidation) (interface{}, error) {
78 if v.RequireCortexResources {

Callers 2

InterfaceFunction · 0.85

Calls 3

ErrorCannotBeNullFunction · 0.85
validateInterfaceFunction · 0.85

Tested by

no test coverage detected