Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 return a bit more verbosy error messages for go-package errors #725

Merged
merged 2 commits into from Nov 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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, 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