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

validation.IN cannot parse byte arrays #72

Closed
ChielTimmermans opened this issue Aug 5, 2019 · 3 comments
Closed

validation.IN cannot parse byte arrays #72

ChielTimmermans opened this issue Aug 5, 2019 · 3 comments

Comments

@ChielTimmermans
Copy link

The validation to check if a value can be found in a given list can not parse byte arrays. I think it is pretty easy to fix. for now i will create a custom function

@qiangxue
Copy link
Member

qiangxue commented Dec 4, 2019

Could you provide an example to explain the problem?

@ChielTimmermans
Copy link
Author

ChielTimmermans commented Dec 4, 2019

When i run the following code

	data := []byte("example")
	err := validation.Validate(data,
		validation.In([]byte("test"), []byte("test2")),
	)
	fmt.Println(err)

I get the error:

panic: runtime error: comparing uncomparable type []uint8

@qiangxue
Copy link
Member

qiangxue commented Dec 5, 2019

Fixed. Thanks!

ltns35 pushed a commit to ltns35/ozzo-validation that referenced this issue Jun 5, 2022
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

No branches or pull requests

2 participants