Skip to content

Commit

Permalink
internal/lsp/cache: don't set an error by default in load
Browse files Browse the repository at this point in the history
Change-Id: Icd4495a37f6a3a2eb148d9a1b1949e3741cdd966
Reviewed-on: https://go-review.googlesource.com/c/tools/+/252980
Reviewed-by: Heschi Kreinick <[email protected]>
  • Loading branch information
stamblerre committed Sep 8, 2020
1 parent acefd22 commit 93a3566
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/lsp/cache/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,12 @@ func (s *snapshot) load(ctx context.Context, scopes ...interface{}) error {
}
event.Error(ctx, "go/packages.Load", err, tag.Snapshot.Of(s.ID()), tag.Directory.Of(cfg.Dir), tag.Query.Of(query), tag.PackageCount.Of(len(pkgs)))
} else {
err = fmt.Errorf("no packages returned")
event.Log(ctx, "go/packages.Load", tag.Snapshot.Of(s.ID()), tag.Directory.Of(cfg.Dir), tag.Query.Of(query), tag.PackageCount.Of(len(pkgs)))
}
if len(pkgs) == 0 {
if err == nil {
err = fmt.Errorf("no packages returned")
}
return errors.Errorf("%v: %w", err, source.PackagesLoadError)
}

Expand Down

0 comments on commit 93a3566

Please sign in to comment.