Skip to content

Commit 13d73b2

Browse files
author
Bryan C. Mills
committed
cmd/go: print a "found" line for each package found instead of each module added
We currently print a "go: finding" line for each missing package during import resolution. However, we are only printing a "go: found" line for each module: if a given module provides multiple packages, we don't indicate the module that we found for the second and later packages. Before this change: $ GO111MODULE=on go get golang.org/x/tools/cmd/html2article@78f9822548c13e2c41cc8039d1492a111240db07 go: found golang.org/x/tools/cmd/html2article in golang.org/x/tools v0.0.0-20190214195451-78f9822548c1 go: finding module for package golang.org/x/net/html go: finding module for package golang.org/x/net/html/atom go: downloading golang.org/x/net v0.0.0-20200202094626-16171245cfb2 go: found golang.org/x/net/html in golang.org/x/net v0.0.0-20200202094626-16171245cfb2 After: $ GO111MODULE=on go get golang.org/x/tools/cmd/html2article@78f9822548c13e2c41cc8039d1492a111240db07 go: found golang.org/x/tools/cmd/html2article in golang.org/x/tools v0.0.0-20190214195451-78f9822548c1 go: finding module for package golang.org/x/net/html/atom go: finding module for package golang.org/x/net/html go: found golang.org/x/net/html in golang.org/x/net v0.0.0-20200202094626-16171245cfb2 go: found golang.org/x/net/html/atom in golang.org/x/net v0.0.0-20200202094626-16171245cfb2 Updates #26152 Updates #33284 Change-Id: I221548749e36bfd6a79efe5edc3645dc5319fd6f Reviewed-on: https://go-review.googlesource.com/c/go/+/219437 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
1 parent bcdd5d0 commit 13d73b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/go/internal/modload/load.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -655,13 +655,13 @@ func (ld *loader) load(roots func() []string) {
655655
if err.newMissingVersion != "" {
656656
base.Fatalf("go: %s: package provided by %s at latest version %s but not at required version %s", pkg.stackText(), err.Module.Path, err.Module.Version, err.newMissingVersion)
657657
}
658+
fmt.Fprintf(os.Stderr, "go: found %s in %s %s\n", pkg.path, err.Module.Path, err.Module.Version)
658659
if added[pkg.path] {
659660
base.Fatalf("go: %s: looping trying to add package", pkg.stackText())
660661
}
661662
added[pkg.path] = true
662663
numAdded++
663664
if !haveMod[err.Module] {
664-
fmt.Fprintf(os.Stderr, "go: found %s in %s %s\n", pkg.path, err.Module.Path, err.Module.Version)
665665
haveMod[err.Module] = true
666666
modAddedBy[err.Module] = pkg
667667
buildList = append(buildList, err.Module)

0 commit comments

Comments
 (0)