-
Originally opened by @zzxwill in cuelang/cue#632 Here are two nested loops.
It generates
But
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Original reply by @verdverm in cuelang/cue#632 (comment) 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/[email protected]/pkg/list#FlattenN |
Beta Was this translation helpful? Give feedback.
-
Original reply by @mpvl in cuelang/cue#632 (comment) Instead of using flatten, you can also drop the inner square brackets. |
Beta Was this translation helpful? Give feedback.
Original reply by @verdverm in cuelang/cue#632 (comment)
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/[email protected]/pkg/list#FlattenN