-
Here are two nested loops.
It generates
But
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
You have nested list comprehensions, so the list of lists is expected. What you want to add is a https://pkg.go.dev/cuelang.org/go@v0.3.0-alpha6/pkg/list#FlattenN |
Beta Was this translation helpful? Give feedback.
-
Instead of using flatten, you can also drop the inner square brackets. |
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#632. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
You have nested list comprehensions, so the list of lists is expected.
What you want to add is a
list.FlattenN([[]], 1)
around your nested list comp.https://pkg.go.dev/cuelang.org/go@v0.3.0-alpha6/pkg/list#FlattenN