Update staging/src/k8s.io/code-generator/cmd/validation-gen/validators/mode.go

Co-authored-by: Joe Betz <jpbetz@google.com>
This commit is contained in:
Aaron Prindle
2026-02-13 00:15:41 -08:00
parent 7e5cd910a4
commit 98c52ccfd7

View File

@@ -409,7 +409,7 @@ func (mtfv *modeTypeOrFieldValidator) getForbiddenValidation(t *types.Type) (any
case types.Pointer:
forbidden = types.Name{Package: libValidationPkg, Name: "ForbiddenPointer"}
case types.Struct:
return nil, fmt.Errorf("can only be used on pointers to structs")
return nil, fmt.Errorf("modal member fields of struct type must be pointers")
default:
forbidden = types.Name{Package: libValidationPkg, Name: "ForbiddenValue"}
}