Skip to content

Commit

Permalink
cue/load: do not format registry as a string
Browse files Browse the repository at this point in the history
I saw an error message like this:

```
import failed: cannot get directory for external module "github.com/cue-labs-modules-testing" (registry &{%!q...): no dependency found for import path "github.com/cue-labs-modules-testing"
```

which is clearly wrong. Unfortunately `go vet` doesn't complain when `%q` is applied to interface arguments.

Signed-off-by: Roger Peppe <[email protected]>
Change-Id: I2ae9fb9765da6274dd17ef643a9e0aca75a3a03d
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1171754
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
  • Loading branch information
rogpeppe committed Nov 6, 2023
1 parent 5365838 commit 4fd631d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cue/load/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func (l *loader) absDirFromImportPath(pos token.Pos, p importPath) (absDir, name
absDir, err = l.externalPackageDir(p)
if err != nil {
// TODO why can't we use %w ?
return "", name, errors.Newf(token.NoPos, "cannot get directory for external module %q (registry %q): %v", p, l.cfg.Registry, err)
return "", name, errors.Newf(token.NoPos, "cannot get directory for external module %q: %v", p, err)
}
} else {
absDir = filepath.Join(GenPath(l.cfg.ModuleRoot), sub)
Expand Down

0 comments on commit 4fd631d

Please sign in to comment.