export CUE definition into a Go structure #1038
Replies: 3 comments 1 reply
-
Please see https://cuelang.org/docs/integrations/go/#generate-go-code (note that as a caveat for now you will end up using deprecated identifiers: this will be fixed by #1035) |
Beta Was this translation helpful? Give feedback.
-
In general, CUE doesn't have the ability to generate the structs in a target language. There are several past issues and discussions you might search for here. We've been using Some interesting difficulties are:
There may also be ideas around proposed solutions to the problem. I've personally written some generators for Go structs with https://github.com/hofstadter-io/hof |
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#1038. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a definition file that looks like this:
I'd like to generate the corresponding Go structures; I expect something like:
I tried to run
Is it the idiomatic way to create a go schema?
Why does it fail?
Beta Was this translation helpful? Give feedback.
All reactions