Replies: 2 comments 8 replies
-
Have a look at https://pkg.go.dev/cuelang.org/[email protected]/cue/load You'd feed the return into You may have to do some fiddling with directory parameters as load will also look at the filesystem, so you won't want anything conflicting from there. You might prefix all of the filenames with an absolute (made up) path. There is an open task to migrate to using |
Beta Was this translation helpful? Give feedback.
-
@maurerbot thanks for raising this as a discussion. Moving good questions like this to GitHub discussions is really helping to improve the discoverability of CUE questions and answers. To build on @verdverm's answer above, see also the example of https://github.com/play-with-go/preguide/blob/e5ab271ba2e92313c56754702035862b357bb48d/preguide.go#L71. To slightly caveat #1117 (reply in thread), we could have added Go 1.16-specific API to CUE using build tags, but it complicates things from a maintainer and user perspective. So far better to, as @verdverm suggested, keep it simple and introduce when we "drop" |
Beta Was this translation helpful? Give feedback.
-
Building tools/cli where cue is used heavily to validating input. We'd like to be able to embed a cue.mod into the binary and boostrap a cue context with it.
Beta Was this translation helpful? Give feedback.
All reactions