]> Cypherpunks repositories - gostls13.git/commit
cmd/go: save sums for zips needed to diagnose ambiguous imports
authorJay Conrod <jayconrod@google.com>
Thu, 15 Oct 2020 22:22:09 +0000 (18:22 -0400)
committerJay Conrod <jayconrod@google.com>
Fri, 23 Oct 2020 20:54:35 +0000 (20:54 +0000)
commit4fdb98dcb1bf7a33565c81db3c00e91a466e098d
tree28733b2e6133ceeee6f48f774bae8c55fd2e187b
parent5cd4390f3853b8d0d2d962f7acdac87c0eba3d77
cmd/go: save sums for zips needed to diagnose ambiguous imports

Previously, we would retain entries in go.sum for .mod files in the
module graph (reachable from the main module) and for .zip files
of modules providing packages.

This isn't quite enough: when we load a package, we need the content
of each module in the build list that *could* provide the package
(that is, each module whose path is a prefix of the package's path) so
we can diagnose ambiguous imports.

For #33008

Change-Id: I0b4d9d68c1f4ca382f0983a3a7e537764f35c3aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/262781
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modload/init.go
src/cmd/go/testdata/mod/example.com_ambiguous_a_b_v0.0.0-empty.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_ambiguous_a_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_sum_ambiguous.txt [new file with mode: 0644]