-
Using 0.4.0-rc.1 I'd like to load one cue file holding definitions, and then load cue instances from various sources (disk for instance). I can't find what's the right Go API to use to achieve that. I assumed that 'context' would retain the definitions already compiled. But the second CompileString in the example below returns an bottom Value.
outputs:
Of course it works when v and #Def are compiled at once.
I'm still trying to wrap my head around how to best use Cue, since I'll import Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The However, you can pass a "scope" which is used to resolve all unresolved identifiers:
|
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#988. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
The
Context
does not retain anything. The context just holds indices for mapping field names, builtins, etc. But there is no retention otherwise.However, you can pass a "scope" which is used to resolve all unresolved identifiers: