Replies: 2 comments 4 replies
-
|
I would use @mvdan's new Which I think gives you what you want? Docs at https://cuelang.org/docs/reference/command/cue-help-exp-gengotypes/, example on cuelang.org to follow (cc @jpluscplusm) |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
FYI, the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Say I have the following
What's the right way to set this up?
CUE Defs
Go Types
CUE Instance
Go Program
Output
➜ code git:(main) ✗ go run ./ inv { apiVersion: "com.verdverm.inventory/v1beta1" kind: "Service" metadata: { name: "foo" labels: {} } spec: { ci: { build: true test: true lint: true push: true } run: { deploy: false env: "dev" port: 4242 } } } main.Service{ Base: main.Base{ ApiVersion: "com.verdverm.inventory/v1beta1", Kind: "Service", Metadata: main.Metadata{ Name: "foo", Labels: {}, }, Spec: main.Spec{}, }, Spec: struct { Run struct { Port int "json:\"port\"" } "json:\"run\"" }{ Run: struct { Port int "json:\"port\"" }{Port:4242}, }, } "" 4242Beta Was this translation helpful? Give feedback.
All reactions