Skip to content

Commit

Permalink
Update pkg/loader/loader.go
Browse files Browse the repository at this point in the history
Co-authored-by: Joe Lanford <joe.lanford@gmail.com>
  • Loading branch information
AlmogBaku and joelanford committed Sep 23, 2022
1 parent 88cee6f commit 37d5986
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/loader/loader.go
Expand Up @@ -404,7 +404,11 @@ func LoadRootsWithConfig(cfg *packages.Config, roots ...string) ([]*Package, err
loadPackages := func(roots ...string) ([]*Package, error) {
rawPkgs, err := packages.Load(l.cfg, roots...)
if err != nil {
return nil, fmt.Errorf("error in %s: %w", l.cfg.Dir, err)
loadRoot := l.cfg.Dir
if l.cfg.Dir == "" {
loadRoot, _ = os.Getwd()
}
return nil, fmt.Errorf("load packages in root %q: %w", loadRoot, err)
}
var pkgs []*Package
for _, rp := range rawPkgs {
Expand Down

0 comments on commit 37d5986

Please sign in to comment.