Check if a variable has some value #482
-
I have a quick question. In Rego language, how to check if a variable has some value and is not undefined? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
default x_is_blah(_) := false
x_is_blah(x) { x == "blah" } Default function values are a new feature, check your OPA version. |
Beta Was this translation helpful? Give feedback.
-
Indeed, it works in OPA 0.55, excellent. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the information, very helpful! |
Beta Was this translation helpful? Give feedback.
It's not possible -- only via passing objects, as a workaround.