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

Function ValidateIntListProvided

pkg/lib/configreader/int_list.go:76–85  ·  view source on GitHub ↗
(val []int, v *IntListValidation)

Source from the content-addressed store, hash-verified

74}
75
76func ValidateIntListProvided(val []int, v *IntListValidation) ([]int, error) {
77 if v.CantBeSpecifiedErrStr != nil {
78 return nil, ErrorFieldCantBeSpecified(*v.CantBeSpecifiedErrStr)
79 }
80
81 if !v.AllowExplicitNull && val == nil {
82 return nil, ErrorCannotBeNull(v.Required)
83 }
84 return validateIntList(val, v)
85}
86
87func validateIntList(val []int, v *IntListValidation) ([]int, error) {
88 if !v.AllowEmpty {

Callers 1

IntListFunction · 0.85

Calls 3

ErrorCannotBeNullFunction · 0.85
validateIntListFunction · 0.85

Tested by

no test coverage detected