diff options
author | Bryan C. Mills <bcmills@google.com> | 2019-07-08 18:11:23 -0400 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2020-02-28 19:04:46 +0000 |
commit | 156c60709e7775a6f1baa9685155b5974fefdea9 (patch) | |
tree | 643dc8cf85c2d1aa0b29b1053ac37bea0b4e43dd /src/cmd/go/internal/modload/load.go | |
parent | d464c7ce29faa90ef2d35d5072c3e7c07606c525 (diff) | |
download | go-156c60709e7775a6f1baa9685155b5974fefdea9.tar.gz go-156c60709e7775a6f1baa9685155b5974fefdea9.zip |
cmd/go/internal/search: record errors in the Match struct
Previously, we would either invoke base.Fatalf (which is too aggressive),
or log.Print (which is too passive).
Updates #32917
Change-Id: I5475e873e76948de7df65dca08bc0ce67a7fc827
Reviewed-on: https://go-review.googlesource.com/c/go/+/185344
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/load.go')
-rw-r--r-- | src/cmd/go/internal/modload/load.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/go/internal/modload/load.go b/src/cmd/go/internal/modload/load.go index b28776b81c..17cfee163c 100644 --- a/src/cmd/go/internal/modload/load.go +++ b/src/cmd/go/internal/modload/load.go @@ -79,7 +79,9 @@ func ImportPathsQuiet(patterns []string, tags map[string]bool) []*search.Match { if m.Literal { dirs = []string{m.Pattern} } else { - dirs = search.MatchPackagesInFS(m.Pattern).Pkgs + match := search.MatchPackagesInFS(m.Pattern) + dirs = match.Pkgs + m.Errs = match.Errs } fsDirs[i] = dirs } @@ -187,7 +189,9 @@ func ImportPathsQuiet(patterns []string, tags map[string]bool) []*search.Match { case search.IsMetaPackage(m.Pattern): // std, cmd if len(m.Pkgs) == 0 { - m.Pkgs = search.MatchPackages(m.Pattern).Pkgs + match := search.MatchPackages(m.Pattern) + m.Pkgs = match.Pkgs + m.Errs = match.Errs } default: |