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

添加regex时报错,提示输入参数过多 #17

Closed
hufuyu opened this issue Aug 30, 2019 · 1 comment
Closed

添加regex时报错,提示输入参数过多 #17

hufuyu opened this issue Aug 30, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@hufuyu
Copy link

hufuyu commented Aug 30, 2019

v.StringRule("code", required|regex:\d{4,6})

panic: validate: the number of parameters given does not match the required. validator 'regex', want 2, given 3

goroutine 1 [running]:
validate.panicf(...)
	validate/helper.go:287
validate.(*funcMeta).checkArgNum(0xc0000c7dc0, 0x3, 0x13ab011, 0x5)
	validate/validators.go:198 +0x1b6
validate.(*Rule).valueValidate(0xc0001ee000, 0x13a874a, 0x4, 0x13a8e15, 0x6, 0x13a8301, 0x1331a60, 0xc0000bae30, 0xc0000f22c0, 0x0)
	validate/validate.go:166 +0x1c7
validate.(*Rule).Apply(0xc0001ee000, 0xc0000f22c0, 0x0)
	validate/validate.go:83 +0x6c0
validate.(*Validation).Validate(0xc0000f22c0, 0x0, 0x0, 0x0, 0xd)
	validate/validation.go:332 +0x10c

exit status 2

@inhere inhere self-assigned this Aug 30, 2019
@inhere inhere closed this as completed in 95eea92 Aug 30, 2019
@inhere inhere added the bug Something isn't working label Aug 30, 2019
@inhere
Copy link
Member

inhere commented Aug 30, 2019

感谢你的报告。

已经修复了,正则包含逗号 解析为多个参数了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants