Replies: 1 comment 2 replies
-
Original reply by @myitcv in cuelang/cue#873 (comment) It's a little tricky to see exactly what you're looking to do here, so I've tried to express it in terms of pure CUE:
And to further confirm, you're looking to use the API to get the value of
Please can you also confirm what version of CUE you are using? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally opened by @brandoshmando in cuelang/cue#873
Hi there! I'm attempting to generate cue primitive values from go code and write out their syntax to a file, but I'm running into some (seemingly) unexpected behavior when actually writing out the values to syntax. In the following simplified example, I'm attempting to generate a pattern for a string field that has a default within a struct.
What's interesting is that the unified value that's generated outputs the syntax that I would expect, i.e.
But once I fill that value into a new struct as
field1
, the syntax seems to evaluate the raw cue and complete the value with its default, i.e.Instead I'd expect (and was hoping) that the syntax would look like this:
Is this expected behavior and if so, is there a way to prevent the raw cue of the
unified
value from evaluating to its default?Beta Was this translation helpful? Give feedback.
All reactions