Replies: 3 comments 2 replies
-
The solution for now (AFAIK) is to use an iterator, per the linked |
Beta Was this translation helpful? Give feedback.
-
While walking CUE values, is it possible to detect "references" like the following, where several values reference or refer to
Is there any API functions in There seem to be many cases or scenarios for this, maybe the API could be expanded if it does not currently support this? |
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#862. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
-
CUE Values have a Walk function (https://pkg.go.dev/cuelang.org/go/[email protected]#Value.Walk)
This function however does not descend into definitions.
What is the recommended way to walk a Value tree across both data and definitions? (custom and AST come to mind as alternatives)
Does it make sense to expand the API to include a function that will walk more of a Value? (using the same
Options
asValue.Fields()
)For reference,
tools/flow
has the following custom walk function: https://cue.googlesource.com/cue/+/v0.3.0-beta.7/tools/flow/tasks.go#64Beta Was this translation helpful? Give feedback.
All reactions