You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "erka (via GitHub)" <gi...@apache.org> on 2026/05/19 12:11:02 UTC
[PR] Precompile regex patterns in Go struct validator [thrift]
erka opened a new pull request, #3495:
URL: https://github.com/apache/thrift/pull/3495
Client: go
Replace inline regexp.MatchString calls with precompiled
regexp.MustCompile variables for literal vt.pattern annotations.
This avoids recompiling the same regex on every Validate() call.
Also fixes two bugs in the original regexp.MatchString usage:
- Arguments were swapped: MatchString(target, pattern) instead
of MatchString(pattern, target)
- Used ; ok instead of ; !ok, causing validation to fail when the
pattern matched instead of when it didn't
---
- [ ] Did you create an [Apache Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket? ([Request account here](https://selfserve.apache.org/jira-account.html), not required for trivial changes)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] THRIFT-6012: Precompile regex patterns in Go struct validator [thrift]
Posted by "kpumuk (via GitHub)" <gi...@apache.org>.
kpumuk merged PR #3495:
URL: https://github.com/apache/thrift/pull/3495
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] THRIFT-6012: Precompile regex patterns in Go struct validator [thrift]
Posted by "kpumuk (via GitHub)" <gi...@apache.org>.
kpumuk commented on PR #3495:
URL: https://github.com/apache/thrift/pull/3495#issuecomment-4493307228
> looks good to me. the lib-netstd failure doesn't seem relevant. cc @Jens-G to double check on that one.
We have merged a fix for that https://github.com/apache/thrift/pull/3501
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org