Skip to content

Commit 5a04616

Browse files
committed
cue/load: use error registry in SkipImports mode
Using the nil registry caused the module file to be read in legacy mode which didn't populate the version, which we need in the next CL. Signed-off-by: Roger Peppe <[email protected]> Change-Id: If20ef63b483bec39642eb0aeafa545ef775d4c2f Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1217213 Reviewed-by: Marcel van Lohuizen <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 86f7a64 commit 5a04616

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cue/load/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ func (c Config) complete() (cfg *Config, err error) {
368368
}
369369
if c.SkipImports {
370370
// We should never use the registry in SkipImports mode
371-
// but nil it out to be sure.
372-
c.Registry = nil
371+
// but make it always return an error just to be sure.
372+
c.Registry = errorRegistry{errors.New("unexpected use of registry in SkipImports mode")}
373373
} else if c.Registry == nil {
374374
registry, err := modconfig.NewRegistry(&modconfig.Config{
375375
Env: c.Env,

0 commit comments

Comments
 (0)