go/src/cmd/go
Jay Conrod ba3dc70dc5 [release-branch.go1.15] cmd/go: don't report missing std import errors for tidy and vendor
'go mod tidy' and 'go mod vendor' normally report errors when a
package can't be imported, even if the import appears in a file that
wouldn't be compiled by the current version of Go. These errors are
common for packages introduced in higher versions of Go, like "embed"
in 1.16.

This change causes 'go mod tidy' and 'go mod vendor' to ignore
missing package errors if the import path appears to come from the
standard library because it lacks a dot in the first path element.

NOTE: This change is not a clean cherry-pick of CL 298749 because
parts of modload were substantially rewritten after 1.15.

Fixes #44792
Updates #27063

Change-Id: I61d6443e77ab95fd8c0d1514f57ef4c8885a77cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/298749
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
(cherry picked from commit 56d52e6611)
Reviewed-on: https://go-review.googlesource.com/c/go/+/298950
2021-03-10 21:25:28 +00:00
..
internal [release-branch.go1.15] cmd/go: don't report missing std import errors for tidy and vendor 2021-03-10 21:25:28 +00:00
testdata [release-branch.go1.15] cmd/go: don't report missing std import errors for tidy and vendor 2021-03-10 21:25:28 +00:00
alldocs.go cmd/go: include GOMODCACHE in 'go help environment' 2020-07-13 17:48:55 +00:00
go11.go
go_test.go cmd/dist: do not unset GOROOT_FINAL prior to running tests 2020-06-09 02:49:06 +00:00
go_unix_test.go
go_windows_test.go cmd/go: factor the I/O-retry logic out of renameio 2019-06-13 15:09:42 +00:00
help_test.go cmd/go: add a few more calls to t.Parallel 2020-02-19 21:58:05 +00:00
init_test.go
main.go cmd/go: add 'go help buildconstraint' 2020-05-01 15:02:30 +00:00
mkalldocs.sh
note_test.go cmd/go: accept smart quotes when checking for missing gold in TestNoteReading 2020-05-20 03:40:22 +00:00
proxy_test.go cmd/go/internal/web: don't follow an infinite number of redirects 2020-06-11 14:40:28 +00:00
script_test.go cmd/dist: do not unset GOROOT_FINAL prior to running tests 2020-06-09 02:49:06 +00:00