Skip to content

Commit 612837a

Browse files
committed
cue/load: avoid "user:" and "instance:" error prefixes
The `cue/load` package currently creates errors with `user:` and/or `instance:` prefixes, which might make sense in the context of the Go API, but don't really make sense on the command line, as evidenced by comments like this: https://review.gerrithub.io/c/cue-lang/cue/+/1194664/8/cmd/cue/cmd/testdata/script/issue174.txtar This change removes those prefixes. This doesn't appear to be covered by any tests, although these prefixes do show up in some errors printed by a later CL, which this improves. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I66670e94c4bd0a45d84a2ed4d6dec6de8d9db758 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194762 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent e888508 commit 612837a

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

cue/load/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ func (c *Config) newErrInstance(err error) *build.Instance {
469469
i := c.Context.NewInstance("", nil)
470470
i.Root = c.ModuleRoot
471471
i.Module = c.Module
472-
i.Err = errors.Promote(err, "instance")
472+
i.Err = errors.Promote(err, "")
473473
return i
474474
}
475475

cue/load/loader.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,7 @@ func (l *loader) cueFilesPackage(files []*build.File) *build.Instance {
143143
pkg.User = true
144144
l.addFiles(l.cfg.Dir, pkg)
145145

146-
l.stk.Push("user")
147146
_ = pkg.Complete()
148-
l.stk.Pop()
149-
//pkg.LocalPrefix = dirToImportPath(dir)
150147
pkg.DisplayPath = "command-line-arguments"
151148

152149
return pkg

0 commit comments

Comments
 (0)