]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go: support replaces in the go.work file
authorMichael Matloob <matloob@golang.org>
Fri, 17 Sep 2021 23:38:33 +0000 (19:38 -0400)
committerMichael Matloob <matloob@golang.org>
Tue, 19 Oct 2021 18:43:08 +0000 (18:43 +0000)
commit1d63052782a7535a3d4ce4557fd23fd97699b249
treea8e30032e10627478de2baefc04d3457e581efce
parent7999fd4710e7f987e86d7b32dd9af31ced4810ba
cmd/go: support replaces in the go.work file

Add support for replace directives in the go.work file. If there are
conflicting replaces in go.mod files, suggest that users add an
overriding replace in the go.work file.

Add HighestReplaced to MainModules so that it accounts for the
replacements in the go.work file.

(Reviewers: I'm not totally sure that HighestReplace is computed
correctly. Could you take a closer look at that?)

For #45713

Change-Id: I1d789219ca1dd065ba009ce5d38db9a1fc38ba83
Reviewed-on: https://go-review.googlesource.com/c/go/+/352812
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
13 files changed:
src/cmd/go/internal/modcmd/vendor.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/build.go
src/cmd/go/internal/modload/import.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/load.go
src/cmd/go/internal/modload/modfile.go
src/cmd/go/internal/modload/query.go
src/cmd/go/internal/modload/vendor.go
src/cmd/go/testdata/script/work_edit.txt
src/cmd/go/testdata/script/work_replace.txt [new file with mode: 0644]
src/cmd/go/testdata/script/work_replace_conflict.txt [new file with mode: 0644]
src/cmd/go/testdata/script/work_replace_conflict_override.txt [new file with mode: 0644]