Fix missing return statements

Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
Émile Ré
2025-12-15 17:20:42 +01:00
parent b81ac0d01c
commit 2f8aef9927
3 changed files with 4 additions and 3 deletions

View File

@@ -258,7 +258,7 @@ func NotOneOfSlice[T any](disallowed []T) ValidatorFunc {
// First try exact match with DeepEqual
for _, disallowedVal := range disallowed {
if reflect.DeepEqual(actualValue, disallowedVal) {
newValidationError(
return newValidationError(
ErrorCodeInvalidEnum,
fmt.Sprintf("must not be one of: %s", strings.Join(disallowedStrings, ", ")),
)
@@ -268,7 +268,7 @@ func NotOneOfSlice[T any](disallowed []T) ValidatorFunc {
// Then try string comparison (for custom string types)
valueStr := fmt.Sprint(actualValue)
if disallowedMap[valueStr] {
newValidationError(
return newValidationError(
ErrorCodeInvalidEnum,
fmt.Sprintf("must not be one of: %s", strings.Join(disallowedStrings, ", ")),
)