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
glob.match without delimiters #4923
Comments
I'm not sure I follow. From my understanding of globs, |
if globs with delimiter |
💡 Got it. So you'd expect Hmm I wonder how we could pull that off without breaking backwards-compatibility. I think it would have to be a new built-in, like |
Can I contribute to this function? |
Would a simple |
In the past, I have used regex for my rego. But I realized golang is not good with regex. You can see results in this benchmark. Then I use glob for this and my application latency goes down. |
Yeah sure, contributions are always welcome. I'm still not sure what the best name is here... 🤔 But we can discuss that later, too. |
Fair enough @vinhph0906! Perhaps we could use |
In the |
Not right now, but I think Anders meant that as a proposal for how to enhance that built-in instead of creating a new one. It's a good idea, I think. |
|
Yeah we can inspect the argument. There are examples of similar functions that work on multiple types, like |
Short description
I used glob.match to valid path. However, without delimiters it will set default
to ["."]
. Therefore, I fail the test case below:Steps To Reproduce
My rego looks like:
result := glob.match("test*",[],"test.txt")
Expected behavior
I expected output is
"result": true
but it is"result": false
.The text was updated successfully, but these errors were encountered: