-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: fix some base32 parsing issues by using go standard library instead of regex #1286
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
base: master
Are you sure you want to change the base?
Conversation
nodivbyzero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Here are the benchmarks:
goos: darwin
goarch: arm64
pkg: github.com/go-playground/validator/v10
cpu: Apple M1
BenchmarkRegexValidation-8 3 077 074 360.4 ns/op 0 B/op 0 allocs/op
PASS
ok github.com/go-playground/validator/v10 1.932s
vs.
goos: darwin
goarch: arm64
pkg: github.com/go-playground/validator/v10
cpu: Apple M1
BenchmarkDecodingValidation-8 9 891 073 121.9 ns/op 48 B/op 3 allocs/op
PASS
ok github.com/go-playground/validator/v10 2.586s
zemzale
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One less regex is a win in my books. LGTM
|
LGTM would you be able to resolve the conflicts, I then will merge this @jamesatkin-myndup |
Fixes Or Enhances
Some strings were failing to be parsed by the previous RegEx based validation. This now uses the Go
base32module (part of the standard library) to more reliably decode the field.Make sure that you've checked the boxes below before you submit PR:
@go-playground/validator-maintainers