Skip to content

Conversation

@samlown
Copy link
Contributor

@samlown samlown commented Feb 23, 2023

This is a copy of go-ozzo/ozzo-validation#160

As per the original PR:

The combination of Elem().Interface() does not return a pointer, even if the original variable was a pointer. Passing by value to validation rules becomes a problem when the value is a struct with a private mutex. This is the case with structs generated with protoc-gen-go. go vet -copylocks illustrates the problem.

I acknowledge this may be a breaking change for some. If they have written custom rules, the rules receive an empty interface and have to cast the argument to the appropriate type. This argument will be a pointer in cases where it previously wasn't.

@samlown samlown merged commit b0498eb into main Feb 23, 2023
rhafer added a commit to rhafer/ocis that referenced this pull request May 30, 2024
invpop/validation is a fork of go-ozzo/ozzo-validation with some additional
bug fixes. Specifically we need: invopop/validation#1
rhafer added a commit to rhafer/ocis that referenced this pull request May 30, 2024
invpop/validation is a fork of go-ozzo/ozzo-validation with some additional
bug fixes. Specifically we need: invopop/validation#1
rhafer added a commit to rhafer/ocis that referenced this pull request Jun 3, 2024
invpop/validation is a fork of go-ozzo/ozzo-validation with some additional
bug fixes. Specifically we need: invopop/validation#1
rhafer added a commit to rhafer/ocis that referenced this pull request Jun 4, 2024
invpop/validation is a fork of go-ozzo/ozzo-validation with some additional
bug fixes. Specifically we need: invopop/validation#1
rhafer added a commit to owncloud/ocis that referenced this pull request Jun 4, 2024
invpop/validation is a fork of go-ozzo/ozzo-validation with some additional
bug fixes. Specifically we need: invopop/validation#1
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.

2 participants