load.Instances has a second argument to configure loading behavior.
cue CLI fills this type from the command and flags.
When loading CUE with Go, we often need to setup this
Config as well.
The Config Type
load.Config type allows you to control the loading process.
To highlight the important parts, we have:
- reduced some of the comments
- removed deprecated fields
- removed advanced or rarely used fields
See the load.Config documentation for complete details.
The following will hopefully connect some of
the Config fields to the
cue CLI options.
The more advanced fields will be covered after with dedicated pages.
Diris working directory for the loader, equivalent to where you run the
ModuleRootis the top-level directory for the CUE module, equivalent to where the
cue.moddirectory is found
Moduleis the module name to use, equivalent to the value in
Packageis the -p / –package flag used when running the
Tagsis -t / –inject flags used when running the
TagVarsare tags provided with predefined values. The load.DefaultTagVars function provides the same as
cue -T. You can also add or provide your own predefined values using the