-
Originally opened by @yannk in cuelang/cue#988 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: 1 comment 2 replies
-
Original reply by @mpvl in cuelang/cue#988 (comment) The However, you can pass a "scope" which is used to resolve all unresolved identifiers:
|
Beta Was this translation helpful? Give feedback.
Original reply by @mpvl in cuelang/cue#988 (comment)
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: