Skip to content

docs: use the registered fieldcontains tag in usage example - #1635

Merged
nodivbyzero merged 1 commit into
go-playground:masterfrom
lazerg:docs/fix-fieldcontains-usage
Sep 25, 2026
Merged

nodivbyzero merged 1 commit into
go-playground:masterfrom
lazerg:docs/fix-fieldcontains-usage

Conversation

@lazerg

@lazerg lazerg commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Fixes Or Enhances

Fixes #1634.

The docs give the field-vs-field contains tag as containsfield, but baked_in.go registers it as fieldcontains. Copying the documented usage line panics with Undefined validation function 'containsfield'. The usage line now spells the tag the way it is registered, same as the fieldexcludes entry right below it.

Make sure that you've checked the boxes below before you submit PR:

  • Tests exist or have been written that cover this particular change (TestFieldContains, which already uses fieldcontains).

@go-playground/validator-maintainers

@lazerg
lazerg requested a review from a team as a code owner September 17, 2026 17:04
@nodivbyzero
nodivbyzero merged commit daf5a2e into go-playground:master Sep 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: The documentation says containsField=InnerStructField.Field, but the implementation uses fieldContains.

2 participants