From e9bdabcb27b473c0a10bd00fb1f6e216c10f4fe3 Mon Sep 17 00:00:00 2001 From: Neil Watts <1678092075@qq.com> Date: Thu, 13 Aug 2026 16:25:10 +0800 Subject: [PATCH] docs: clarify fieldexcludes behavior --- README.md | 2 +- doc.go | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 88d3b4d4..8129082d 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ validate := validator.New(validator.WithRequiredStructEnabled()) | eqcsfield | Field Equals Another Field (relative)| | eqfield | Field Equals Another Field | | fieldcontains | Check the indicated characters are present in the Field | -| fieldexcludes | Check the indicated characters are not present in the field | +| fieldexcludes | Current field does not contain another field's value | | gtcsfield | Field Greater Than Another Relative Field | | gtecsfield | Field Greater Than or Equal To Another Relative Field | | gtefield | Field Greater Than or Equal To Another Field | diff --git a/doc.go b/doc.go index a8c5c40c..bcc0e19e 100644 --- a/doc.go +++ b/doc.go @@ -803,13 +803,14 @@ other types. Usage: containsfield=InnerStructField.Field -# Field Excludes Another Field +# Field Excludes Another Field's Value -This does the same as excludes except for struct fields. It should only be used -with string types. See the behavior of reflect.Value.String() for behavior on -other types. +This validates that the current field's string value does not contain the +string value of the field named by the parameter. It should only be used with +string types. If the referenced field cannot be resolved, validation succeeds. +See the behavior of reflect.Value.String() for behavior on other types. - Usage: excludesfield=InnerStructField.Field + Usage: fieldexcludes=InnerStructField.Field # Unique