]> Cypherpunks repositories - gostls13.git/commit
cmd/go: forbid use of one module with two different paths
authorBryan C. Mills <bcmills@google.com>
Thu, 26 Jul 2018 20:42:15 +0000 (16:42 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 31 Jul 2018 02:02:51 +0000 (02:02 +0000)
commit68170aa677b9fc70ce3d0fc152354e0a7e63c8cf
tree12060b6045713ca2b26c1979a74bc08df4d6c58d
parent682faae2e32b8b39ff812e8d1d31591125d31f3f
cmd/go: forbid use of one module with two different paths

If a single module is imported via two different paths (e.g., as itself and as a
replacement for something else), some users may be surprised if the two paths
do not share the same package-level state. Others may be surprised if the two
paths do share state.

Punt on the question for now by rejecting that condition explicitly.

Fixes #26607.

Change-Id: I15c3889f61f8dd4ba5e5c48ca33ad63aeecac04e
Reviewed-on: https://go-review.googlesource.com/126156
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/internal/modload/load.go
src/cmd/go/testdata/script/mod_replace.txt [new file with mode: 0644]