-
I would like to define a struct that accomplishes the following:
Is this possible? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
With the API or in CUE directly? In CUE directly you can write:
Comparing against bottom is not specified in the spec, or at the very least it is poorly defined. I've written (but still need to publish) a relatively minor change, replacing this with builtins like In the API you can do a |
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#887. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
With the API or in CUE directly?
In CUE directly you can write:
Comparing against bottom is not specified in the spec, or at the very least it is poorly defined. I've written (but still need to publish) a relatively minor change, replacing this with builtins like
isdefined(optional)
. But for now this works.In the API you can do a
LookupPath
and see whether the resulting value exists.