Skip to content

Conversation

@Jake-Convictional
Copy link
Contributor

@Jake-Convictional Jake-Convictional commented Mar 31, 2021

Fixes Or Enhances

Closes #745

Using a tag like excluded_with will now work as expected on pointer fields (e.g. *string). There are two commits here. The first commit adds in tests (which fail) to demonstrate the behavior that was missing. The second commit improves the code so that the tests pass.

I checked to see if this would also address this comment about struct pointers, but it does not.

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

  • Tests exist or have been written that cover this particular change.

@go-playground/admins

Field3 map[string]string `validate:"excluded_without_all=Field FieldE" json:"field_3"`
Field4 interface{} `validate:"excluded_without_all=Field FieldE" json:"field_4"`
Field5 string `validate:"excluded_without_all=Inner.Field Inner.Field2" json:"field_5"`
Field5 string `validate:"excluded_without_all=Inner.Field Inner2.Field" json:"field_5"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed like a typo

@coveralls
Copy link

Coverage Status

Coverage remained the same at 76.07% when pulling b42122c on Jake-Convictional:exclude-nil into f6584a4 on go-playground:master.

@deankarn deankarn merged commit 9c415c4 into go-playground:master Apr 6, 2021
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.

exclude_with and exclude_without don't work on pointer fields

3 participants