Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #352 Returns error when passing pointer to RegisterStructValidation #413

Merged
merged 3 commits into from
Nov 4, 2018

Conversation

suekto-andreas
Copy link
Contributor

Fixes #352.

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

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

Change Details:

  • Returns error on pointer type detection at RegisterStructValidationCtx
  • Returns error at RegisterStructValidation

@go-playground/admins

@coveralls
Copy link

coveralls commented Nov 2, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 8ed00e2 on suekto-andreas:v9 into 3be3142 on go-playground:v9.


if v.structLevelFuncs == nil {
v.structLevelFuncs = make(map[reflect.Type]StructLevelFuncCtx)
}

for _, t := range types {
if reflect.ValueOf(t).Kind() == reflect.Ptr {
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you tried using Elem or Indirect to automatically downgrade instead of returning an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @joeybloggs, pushed a commit using Indirect to downgrade it

@deankarn deankarn merged commit 1730262 into go-playground:v9 Nov 4, 2018
fairyhunter13 added a commit to fairyhunter13/validator that referenced this pull request Jul 12, 2020
Fix go-playground#352 Returns error when passing pointer to RegisterStructValidation
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.

None yet

3 participants