]> Cypherpunks repositories - gostls13.git/commit
cmd/go: resolve std-vendored dependencies as std packages except in 'go get' and...
authorBryan C. Mills <bcmills@google.com>
Tue, 2 Mar 2021 14:52:55 +0000 (09:52 -0500)
committerBryan C. Mills <bcmills@google.com>
Tue, 2 Mar 2021 19:15:52 +0000 (19:15 +0000)
commite9eed78dc3f4ab9a87f43c7d902025329f622783
treedfa136ec86614d48896433aff9d342416acd7bb9
parent09f4ef4fa73a110eefd2cb9d78439f51d9294f65
cmd/go: resolve std-vendored dependencies as std packages except in 'go get' and 'go mod'

In CL 251159, I removed a hard-coded special case changing the
rewriting behavior for std dependencies in GOROOT/src/vendor and
GOROOT/src/cmd/vendor. Unfortunately, that caused packages in 'std' to
be reported as stale when run within GOROOT/src.

This change restores the special-case behavior, but plumbs it through
the PackageOpts explicitly instead of comparing strings stored in
global variables.

Fixes #44725

Change-Id: If084fe74972ce1704715ca79b0b7e092dd90c88b
Reviewed-on: https://go-review.googlesource.com/c/go/+/297869
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modcmd/tidy.go
src/cmd/go/internal/modcmd/vendor.go
src/cmd/go/internal/modcmd/why.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/load.go
src/cmd/go/testdata/script/list_std_stale.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_list_std.txt
src/cmd/go/testdata/script/mod_std_vendor.txt