cmd/go: replace
directive for go modules does not work recursively
#38665
Labels
FrozenDueToAge
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?1.14
Does this issue reproduce with the latest release?
YES
What operating system and processor architecture are you using (
go env
)?Linux, AMD64
What did you do?
I have the directory structure as follows:
File
module1/go.mod
:File
module1/test.go
:File
module2/go.mod
:File
module2/test.go
:File
module3/go.mod
:File
module3/test.go
:Summary:
module1
depends on a local modulemodule2
, andmodule2
depends on another local modulemodule3
. I usereplace
directive in the twogo.mod
files inmodule1
andmodule2
.What did you expect to see?
When I try
go build
inmodule1
, it is expected that the compiler findmodule2
andmodule3
in the local filesystem, rather than fetching them from a remote server.What did you see instead?
The go compiler succeeded in figuring out the right source of
module2
(in local directorytop-dir/module2
), but failed formodule3
. It attempted to fetchmodule3
from the servercompany.com
:The text was updated successfully, but these errors were encountered: