x/vgo: incorporate current Go 1.11 development tree

This CL corresponds to ee2e8ecb19d
(https://golang.org/cl/118375) in the main repo.

After this CL, "vgo vet" only works with the Go 1.11 tree.
It's now a no-op when using a Go 1.10 tree.

Change-Id: Ie3dd17f3833a9189d282abaf416e372616bf50cf
Reviewed-on: https://go-review.googlesource.com/118096
Reviewed-by: Bryan C. Mills <bcmills@google.com>
diff --git a/vendor/cmd/go/alldocs.go b/vendor/cmd/go/alldocs.go
index 5231eb7..06d496b 100644
--- a/vendor/cmd/go/alldocs.go
+++ b/vendor/cmd/go/alldocs.go
@@ -7,6 +7,10 @@
 
 // Go is a tool for managing Go source code.
 //
+// This is vgo, an experimental go command with support for package versioning.
+// Even though you are invoking it as vgo, most of the messages printed will
+// still say "go", not "vgo". Sorry.
+//
 // Usage:
 //
 // 	go command [arguments]
@@ -27,6 +31,8 @@
 // 	run         compile and run Go program
 // 	test        test packages
 // 	tool        run specified go tool
+// 	vendor      vendor dependencies of current module
+// 	verify      verify downloaded modules against expected hashes
 // 	version     print Go version
 // 	vet         report likely mistakes in packages
 //
@@ -105,7 +111,7 @@
 // 		Supported only on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64.
 // 	-msan
 // 		enable interoperation with memory sanitizer.
-// 		Supported only on linux/amd64,
+// 		Supported only on linux/amd64, linux/arm64
 // 		and only with Clang/LLVM as the host C compiler.
 // 	-v
 // 		print the names of packages as they are compiled.
@@ -579,7 +585,7 @@
 //
 // Usage:
 //
-// 	go list [-e] [-f format] [-json] [build flags] [packages]
+// 	go list [-cgo] [-deps] [-e] [-export] [-f format] [-json] [-list] [-test] [build flags] [packages]
 //
 // List lists the packages named by the import paths, one per line.
 //
@@ -609,6 +615,9 @@
 //         Root          string // Go root or Go path dir containing this package
 //         ConflictDir   string // this directory shadows Dir in $GOPATH
 //         BinaryOnly    bool   // binary-only package: cannot be recompiled from sources
+//         ForTest       string // package is only for use in named test
+//         DepOnly       bool   // package is only a dependency, not explicitly listed
+//         Export        string // file containing export data (when using -export)
 //
 //         // Source files
 //         GoFiles        []string // .go source files (excluding CgoFiles, TestGoFiles, XTestGoFiles)
@@ -683,6 +692,16 @@
 // The -json flag causes the package data to be printed in JSON format
 // instead of using the template format.
 //
+// The -cgo flag causes list to set CgoFiles not to the original *.go files
+// importing "C" but instead to the translated files generated by the cgo
+// command.
+//
+// The -deps flag causes list to iterate over not just the named packages
+// but also all their dependencies. It visits them in a depth-first post-order
+// traversal, so that a package is listed only after all its dependencies.
+// Packages not explicitly listed on the command line will have the DepOnly
+// field set to true.
+//
 // The -e flag changes the handling of erroneous packages, those that
 // cannot be found or are malformed. By default, the list command
 // prints an error to standard error for each erroneous package and
@@ -693,6 +712,32 @@
 // a non-nil Error field; other information may or may not be missing
 // (zeroed).
 //
+// The -export flag causes list to set the Export field to the name of a
+// file containing up-to-date export information for the given package.
+//
+// The -test flag causes list to report not only the named packages
+// but also their test binaries (for packages with tests), to convey to
+// source code analysis tools exactly how test binaries are constructed.
+// The reported import path for a test binary is the import path of
+// the package followed by a ".test" suffix, as in "math/rand.test".
+// When building a test, it is sometimes necessary to rebuild certain
+// dependencies specially for that test (most commonly the tested
+// package itself). The reported import path of a package recompiled
+// for a particular test binary is followed by a space and the name of
+// the test binary in brackets, as in "math/rand [math/rand.test]"
+// or "regexp [sort.test]". The ForTest field is also set to the name
+// of the package being tested ("math/rand" or "sort" in the previous
+// examples).
+//
+// The Dir, Target, Shlib, Root, ConflictDir, and Export file paths
+// are all absolute paths.
+//
+// By default, the lists GoFiles, CgoFiles, and so on hold names of files in Dir
+// (that is, paths relative to Dir, not absolute paths).
+// The extra entries added by the -cgo and -test flags are absolute paths
+// referring to cached copies of generated Go source files.
+// Although they are Go source files, the paths may not end in ".go".
+//
 // For more about build flags, see 'go help build'.
 //
 // For more about specifying packages, see 'go help packages'.
@@ -702,10 +747,12 @@
 //
 // Usage:
 //
-// 	go run [build flags] [-exec xprog] gofiles... [arguments...]
+// 	go run [build flags] [-exec xprog] package [arguments...]
 //
-// Run compiles and runs the main package comprising the named Go source files.
-// A Go source file is defined to be a file ending in a literal ".go" suffix.
+// Run compiles and runs the named main Go package.
+// Typically the package is specified as a list of .go source files,
+// but it may also be an import path, file system path, or pattern
+// matching a single known package, as in 'go run .' or 'go run my/cmd'.
 //
 // By default, 'go run' runs the compiled binary directly: 'a.out arguments...'.
 // If the -exec flag is given, 'go run' invokes the binary using xprog:
@@ -717,7 +764,10 @@
 // cross-compiled programs when a simulator or other execution method is
 // available.
 //
+// The exit status of Run is not the exit status of the compiled binary.
+//
 // For more about build flags, see 'go help build'.
+// For more about specifying packages, see 'go help packages'.
 //
 // See also: go build.
 //
@@ -753,9 +803,12 @@
 //
 // As part of building a test binary, go test runs go vet on the package
 // and its test source files to identify significant problems. If go vet
-// finds any problems, go test reports those and does not run the test binary.
-// Only a high-confidence subset of the default go vet checks are used.
-// To disable the running of go vet, use the -vet=off flag.
+// finds any problems, go test reports those and does not run the test
+// binary. Only a high-confidence subset of the default go vet checks are
+// used. That subset is: 'atomic', 'bool', 'buildtags', 'nilfunc', and
+// 'printf'. You can see the documentation for these and other vet tests
+// via "go doc cmd/vet". To disable the running of go vet, use the
+// -vet=off flag.
 //
 // All test output and summary lines are printed to the go command's
 // standard output, even if the test printed them to its own standard
@@ -857,6 +910,39 @@
 // For more about each tool command, see 'go doc cmd/<command>'.
 //
 //
+// Vendor dependencies of current module
+//
+// Usage:
+//
+// 	go vendor [-v]
+//
+// Vendor resets the module's vendor directory to include all
+// packages needed to builds and test all packages in the module
+// and their dependencies.
+//
+// The -v flag causes vendor to print the module paths of the
+// modules processed and the import paths of the packages
+// copied.
+//
+//
+// Verify downloaded modules against expected hashes
+//
+// Usage:
+//
+// 	go verify
+//
+// Verify checks that the dependencies of the current module,
+// which are stored in a local downloaded source cache,
+// have not been modified since being downloaded.
+//
+// If all the modules are unmodified, verify prints
+//
+// 	all modules verified
+//
+// and exits successfully (status 0). Otherwise, verify reports
+// which modules have been changed and exits with a non-zero status.
+//
+//
 // Print Go version
 //
 // Usage:
@@ -1007,6 +1093,9 @@
 // 		Examples are amd64, 386, arm, ppc64.
 // 	GOBIN
 // 		The directory where 'go install' will install a command.
+// 	GOCACHE
+// 		The directory where the go command will store cached
+// 		information for reuse in future builds.
 // 	GOOS
 // 		The operating system for which to compile code.
 // 		Examples are linux, darwin, windows, netbsd.
@@ -1020,9 +1109,10 @@
 // 	GOTMPDIR
 // 		The directory where the go command will write
 // 		temporary source files, packages, and binaries.
-// 	GOCACHE
-// 		The directory where the go command will store
-// 		cached information for reuse in future builds.
+// 	GOTOOLDIR
+// 		The directory where the go tools (compile, cover, doc, etc...)
+// 		are installed. This is printed by go env, but setting the
+// 		environment variable has no effect.
 //
 // Environment variables for use with cgo:
 //
@@ -1069,9 +1159,15 @@
 // 	GOMIPS
 // 		For GOARCH=mips{,le}, whether to use floating point instructions.
 // 		Valid values are hardfloat (default), softfloat.
+// 	GOMIPS64
+// 		For GOARCH=mips64{,le}, whether to use floating point instructions.
+// 		Valid values are hardfloat (default), softfloat.
 //
 // Special-purpose environment variables:
 //
+// 	GCCGOTOOLDIR
+// 		If set, where to find gccgo tools, such as cgo.
+// 		The default is based on how gccgo was configured.
 // 	GOROOT_FINAL
 // 		The root of the installed Go tree, when it is
 // 		installed in a location other than where it is built.
@@ -1679,14 +1775,13 @@
 // 	    Writes test binary as -c would.
 //
 // 	-memprofile mem.out
-// 	    Write a memory profile to the file after all tests have passed.
+// 	    Write an allocation profile to the file after all tests have passed.
 // 	    Writes test binary as -c would.
 //
 // 	-memprofilerate n
-// 	    Enable more precise (and expensive) memory profiles by setting
-// 	    runtime.MemProfileRate. See 'go doc runtime.MemProfileRate'.
-// 	    To profile all memory allocations, use -test.memprofilerate=1
-// 	    and pass --alloc_space flag to the pprof tool.
+// 	    Enable more precise (and expensive) memory allocation profiles by
+// 	    setting runtime.MemProfileRate. See 'go doc runtime.MemProfileRate'.
+// 	    To profile all memory allocations, use -test.memprofilerate=1.
 //
 // 	-mutexprofile mutex.out
 // 	    Write a mutex contention profile to the specified file
@@ -1736,6 +1831,12 @@
 // the package list would have to appear before -myflag, but could appear
 // on either side of -v.
 //
+// When 'go test' runs in package list mode, 'go test' caches successful
+// package test results to avoid unnecessary repeated running of tests. To
+// disable test caching, use any test flag or argument other than the
+// cacheable flags. The idiomatic way to disable test caching explicitly
+// is to use -count=1.
+//
 // To keep an argument for a test binary from being interpreted as a
 // known flag or a package name, use -args (see 'go help test') which
 // passes the remainder of the command line through to the test binary
diff --git a/vendor/cmd/go/go_test.go b/vendor/cmd/go/go_test.go
index f354395..9a39c11 100644
--- a/vendor/cmd/go/go_test.go
+++ b/vendor/cmd/go/go_test.go
@@ -10,6 +10,7 @@
 	"debug/macho"
 	"fmt"
 	"go/format"
+	"internal/race"
 	"internal/testenv"
 	"io"
 	"io/ioutil"
@@ -24,8 +25,6 @@
 	"time"
 )
 
-const raceEnabled = false
-
 var (
 	canRun  = true  // whether we can run go or ./testgo
 	canRace = false // whether we can run the race detector
@@ -49,7 +48,7 @@
 
 func init() {
 	switch runtime.GOOS {
-	case "android", "nacl":
+	case "android", "js", "nacl":
 		canRun = false
 	case "darwin":
 		switch runtime.GOARCH {
@@ -100,6 +99,7 @@
 var testGOROOT string
 
 var testCC string
+var testGOCACHE string
 
 // The TestMain function creates a go command for testing purposes and
 // deletes it after the tests have been run.
@@ -114,7 +114,7 @@
 
 	if canRun {
 		args := []string{"build", "-tags", "testgo", "-o", "testgo" + exeSuffix, "../../.."}
-		if raceEnabled {
+		if race.Enabled {
 			args = append(args, "-race")
 		}
 		gotool, err := testenv.GoTool()
@@ -176,6 +176,13 @@
 			}
 		}
 
+		out, err = exec.Command(gotool, "env", "GOCACHE").CombinedOutput()
+		if err != nil {
+			fmt.Fprintf(os.Stderr, "could not find testing GOCACHE: %v\n%s", err, out)
+			os.Exit(2)
+		}
+		testGOCACHE = strings.TrimSpace(string(out))
+
 		// As of Sept 2017, MSan is only supported on linux/amd64.
 		// https://github.com/google/sanitizers/wiki/MemorySanitizer#getting-memorysanitizer
 		canMSan = canCgo && runtime.GOOS == "linux" && runtime.GOARCH == "amd64"
@@ -184,7 +191,7 @@
 		case "linux", "darwin", "freebsd", "windows":
 			// The race detector doesn't work on Alpine Linux:
 			// golang.org/issue/14481
-			canRace = canCgo && runtime.GOARCH == "amd64" && !isAlpineLinux()
+			canRace = canCgo && runtime.GOARCH == "amd64" && !isAlpineLinux() && runtime.Compiler != "gccgo"
 		}
 	}
 	// Don't let these environment variables confuse the test.
@@ -199,7 +206,7 @@
 	}
 	os.Setenv("HOME", "/test-go-home-does-not-exist")
 	if os.Getenv("GOCACHE") == "" {
-		os.Setenv("GOCACHE", "off") // because $HOME is gone
+		os.Setenv("GOCACHE", testGOCACHE) // because $HOME is gone
 	}
 
 	r := m.Run()
@@ -237,6 +244,13 @@
 	stdout, stderr bytes.Buffer
 }
 
+// skipIfGccgo skips the test if using gccgo.
+func skipIfGccgo(t *testing.T, msg string) {
+	if runtime.Compiler == "gccgo" {
+		t.Skipf("skipping test not supported on gccgo: %s", msg)
+	}
+}
+
 // testgo sets up for a test that runs testgo.
 func testgo(t *testing.T) *testgoData {
 	t.Helper()
@@ -805,6 +819,7 @@
 }
 
 func TestProgramNameInCrashMessages(t *testing.T) {
+	skipIfGccgo(t, "gccgo does not use cmd/link")
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.parallel()
@@ -825,7 +840,7 @@
 }
 
 func TestGoBuildDashAInDevBranch(t *testing.T) {
-	t.Skip("broken in standard distribution")
+	t.Skip("vgo")
 
 	if testing.Short() {
 		t.Skip("don't rebuild the standard library in short mode")
@@ -843,7 +858,7 @@
 }
 
 func TestGoBuildDashAInReleaseBranch(t *testing.T) {
-	t.Skip("broken in standard distribution")
+	t.Skip("vgo")
 
 	if testing.Short() {
 		t.Skip("don't rebuild the standard library in short mode")
@@ -867,8 +882,6 @@
 }
 
 func TestNewReleaseRebuildsStalePackagesInGOPATH(t *testing.T) {
-	t.Skip("broken in standard distribution")
-
 	if testing.Short() {
 		t.Skip("don't rebuild the standard library in short mode")
 	}
@@ -894,9 +907,11 @@
 		}
 	}
 
-	tg.tempFile("d1/src/p1/p1.go", `package p1`)
+	// Every main package depends on the "runtime".
+	tg.tempFile("d1/src/p1/p1.go", `package main; func main(){}`)
 	tg.setenv("GOPATH", tg.path("d1"))
-	tg.run("install", "-a", "p1")
+	// Pass -i flag to rebuild everything outdated.
+	tg.run("install", "-i", "p1")
 	tg.wantNotStale("p1", "", "./testgo list claims p1 is stale, incorrectly, before any changes")
 
 	// Changing mtime of runtime/internal/sys/sys.go
@@ -918,13 +933,13 @@
 	tg.wantNotStale("p1", "", "./testgo list claims p1 is stale, incorrectly, after changing back to old release")
 	addNL(sys)
 	tg.wantStale("p1", "stale dependency: runtime/internal/sys", "./testgo list claims p1 is NOT stale, incorrectly, after changing sys.go again")
-	tg.run("install", "p1")
+	tg.run("install", "-i", "p1")
 	tg.wantNotStale("p1", "", "./testgo list claims p1 is stale after building with new release")
 
 	// Restore to "old" release.
 	restore()
 	tg.wantStale("p1", "stale dependency: runtime/internal/sys", "./testgo list claims p1 is NOT stale, incorrectly, after restoring sys.go")
-	tg.run("install", "p1")
+	tg.run("install", "-i", "p1")
 	tg.wantNotStale("p1", "", "./testgo list claims p1 is stale after building with old release")
 
 	// Everything is out of date. Rebuild to leave things in a better state.
@@ -932,6 +947,7 @@
 }
 
 func TestGoListStandard(t *testing.T) {
+	skipIfGccgo(t, "gccgo does not have GOROOT")
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -1245,6 +1261,7 @@
 }
 
 func TestInternalPackagesInGOROOTAreRespected(t *testing.T) {
+	skipIfGccgo(t, "gccgo does not have GOROOT")
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.runFail("build", "-v", "./testdata/testinternal")
@@ -1268,6 +1285,18 @@
 	tg.grepStderr(`testdata(\/|\\)src(\/|\\)run(\/|\\)bad\.go\:3\:8\: use of internal package run/subdir/internal/private not allowed`, "unexpected error for run/bad.go")
 }
 
+func TestRunPkg(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	dir := filepath.Join(tg.pwd(), "testdata")
+	tg.setenv("GOPATH", dir)
+	tg.run("run", "hello")
+	tg.grepStderr("hello, world", "did not find hello, world")
+	tg.cd(filepath.Join(dir, "src/hello"))
+	tg.run("run", ".")
+	tg.grepStderr("hello, world", "did not find hello, world")
+}
+
 func testMove(t *testing.T, vcs, url, base, config string) {
 	testenv.MustHaveExternalNetwork(t)
 
@@ -1366,6 +1395,25 @@
 	tg.grepStderr("found import comments", "go build did not mention comment conflict")
 }
 
+func TestImportCycle(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata/importcycle"))
+	tg.runFail("build", "selfimport")
+
+	count := tg.grepCountBoth("import cycle not allowed")
+	if count == 0 {
+		t.Fatal("go build did not mention cyclical import")
+	}
+	if count > 1 {
+		t.Fatal("go build mentioned import cycle more than once")
+	}
+
+	// Don't hang forever.
+	tg.run("list", "-e", "-json", "selfimport")
+}
+
 // cmd/go: custom import path checking should not apply to Go packages without import comment.
 func TestIssue10952(t *testing.T) {
 	testenv.MustHaveExternalNetwork(t)
@@ -1628,8 +1676,8 @@
 	tg.tempFile("src/p1/p1.go", "package main\n")
 	tg.tempFile("src/p1/p1_test.go", "package main\nimport \"testing\"\nfunc Test(t *testing.T){}\n")
 	tg.run("test", "-c", "-n", "p1")
-	tg.grepBothNot(`[\\/]compile.* -p main.*p1\.go`, "should not have run compile -p main p1.go")
-	tg.grepStderr(`[\\/]compile.* -p p1.*p1\.go`, "should have run compile -p p1 p1.go")
+	tg.grepBothNot(`([\\/]compile|gccgo).* (-p main|-fgo-pkgpath=main).*p1\.go`, "should not have run compile -p main p1.go")
+	tg.grepStderr(`([\\/]compile|gccgo).* (-p p1|-fgo-pkgpath=p1).*p1\.go`, "should have run compile -p p1 p1.go")
 }
 
 // The runtime version string takes one of two forms:
@@ -1640,6 +1688,7 @@
 
 // Issue 12690
 func TestPackageNotStaleWithTrailingSlash(t *testing.T) {
+	skipIfGccgo(t, "gccgo does not have GOROOT")
 	tg := testgo(t)
 	defer tg.cleanup()
 
@@ -1851,6 +1900,7 @@
 }
 
 func TestGoListCmdOnlyShowsCommands(t *testing.T) {
+	skipIfGccgo(t, "gccgo does not have GOROOT")
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -1890,6 +1940,106 @@
 	tg.tempFile("src/p1/p2/p3/p4/p.go", "package p4\n")
 	tg.run("list", "-f", "{{.Deps}}", "p1")
 	tg.grepStdout("p1/p2/p3/p4", "Deps(p1) does not mention p4")
+
+	tg.run("list", "-deps", "p1")
+	tg.grepStdout("p1/p2/p3/p4", "-deps p1 does not mention p4")
+
+	// Check the list is in dependency order.
+	tg.run("list", "-deps", "math")
+	want := "internal/cpu\nunsafe\nmath\n"
+	out := tg.stdout.String()
+	if !strings.Contains(out, "internal/cpu") {
+		// Some systems don't use internal/cpu.
+		want = "unsafe\nmath\n"
+	}
+	if tg.stdout.String() != want {
+		t.Fatalf("list -deps math: wrong order\nhave %q\nwant %q", tg.stdout.String(), want)
+	}
+}
+
+func TestGoListTest(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.makeTempdir()
+	tg.setenv("GOCACHE", tg.tempdir)
+
+	tg.run("list", "-test", "-deps", "sort")
+	tg.grepStdout(`^sort.test$`, "missing test main")
+	tg.grepStdout(`^sort$`, "missing real sort")
+	tg.grepStdout(`^sort \[sort.test\]$`, "missing test copy of sort")
+	tg.grepStdout(`^testing \[sort.test\]$`, "missing test copy of testing")
+	tg.grepStdoutNot(`^testing$`, "unexpected real copy of testing")
+
+	tg.run("list", "-test", "sort")
+	tg.grepStdout(`^sort.test$`, "missing test main")
+	tg.grepStdout(`^sort$`, "missing real sort")
+	tg.grepStdoutNot(`^sort \[sort.test\]$`, "unexpected test copy of sort")
+	tg.grepStdoutNot(`^testing \[sort.test\]$`, "unexpected test copy of testing")
+	tg.grepStdoutNot(`^testing$`, "unexpected real copy of testing")
+
+	tg.run("list", "-test", "cmd/dist", "cmd/doc")
+	tg.grepStdout(`^cmd/dist$`, "missing cmd/dist")
+	tg.grepStdout(`^cmd/doc$`, "missing cmd/doc")
+	tg.grepStdout(`^cmd/doc\.test$`, "missing cmd/doc test")
+	tg.grepStdoutNot(`^cmd/dist\.test$`, "unexpected cmd/dist test")
+	tg.grepStdoutNot(`^testing`, "unexpected testing")
+
+	tg.run("list", "-test", "runtime/cgo")
+	tg.grepStdout(`^runtime/cgo$`, "missing runtime/cgo")
+
+	tg.run("list", "-deps", "-f", "{{if .DepOnly}}{{.ImportPath}}{{end}}", "sort")
+	tg.grepStdout(`^reflect$`, "missing reflect")
+	tg.grepStdoutNot(`^sort`, "unexpected sort")
+}
+
+func TestGoListCgo(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.makeTempdir()
+	tg.setenv("GOCACHE", tg.tempdir)
+
+	tg.run("list", "-f", `{{join .CgoFiles "\n"}}`, "net")
+	if tg.stdout.String() == "" {
+		t.Skip("net does not use cgo")
+	}
+	if strings.Contains(tg.stdout.String(), tg.tempdir) {
+		t.Fatalf(".CgoFiles without -cgo unexpectedly mentioned cache %s", tg.tempdir)
+	}
+	tg.run("list", "-cgo", "-f", `{{join .CgoFiles "\n"}}`, "net")
+	if !strings.Contains(tg.stdout.String(), tg.tempdir) {
+		t.Fatalf(".CgoFiles with -cgo did not mention cache %s", tg.tempdir)
+	}
+	for _, file := range strings.Split(tg.stdout.String(), "\n") {
+		if file == "" {
+			continue
+		}
+		if _, err := os.Stat(file); err != nil {
+			t.Fatalf("cannot find .CgoFiles result %s: %v", file, err)
+		}
+	}
+}
+
+func TestGoListExport(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.makeTempdir()
+	tg.setenv("GOCACHE", tg.tempdir)
+
+	tg.run("list", "-f", "{{.Export}}", "strings")
+	if tg.stdout.String() != "" {
+		t.Fatalf(".Export without -export unexpectedly set")
+	}
+	tg.run("list", "-export", "-f", "{{.Export}}", "strings")
+	file := strings.TrimSpace(tg.stdout.String())
+	if file == "" {
+		t.Fatalf(".Export with -export was empty")
+	}
+	if _, err := os.Stat(file); err != nil {
+		t.Fatalf("cannot find .Export result %s: %v", file, err)
+	}
 }
 
 // Issue 4096. Validate the output of unsuccessful go install foo/quxx.
@@ -1975,9 +2125,6 @@
 	tg.grepStdout(regexp.QuoteMeta(tg.path("home/go")), "want GOPATH=$HOME/go")
 
 	tg.setenv("GOROOT", tg.path("home/go"))
-	tg.must(os.MkdirAll(tg.path("home/go/src/cmd/internal/objabi"), 0777))
-	tg.must(copyFile(filepath.Join(runtime.GOROOT(), "src/cmd/internal/objabi/zbootstrap.go"), tg.path("home/go/src/cmd/internal/objabi/zbootstrap.go"), 0666)) // for vgo
-
 	tg.run("env", "GOPATH")
 	tg.grepStdoutNot(".", "want unset GOPATH because GOROOT=$HOME/go")
 
@@ -2026,7 +2173,7 @@
 // Issue 4186. go get cannot be used to download packages to $GOROOT.
 // Test that without GOPATH set, go get should fail.
 func TestGoGetIntoGOROOT(t *testing.T) {
-	t.Skip("vgo detects fake GOROOT")
+	t.Skip("vgo")
 
 	testenv.MustHaveExternalNetwork(t)
 
@@ -2077,6 +2224,7 @@
 }
 
 func TestLdflagsArgumentsWithSpacesIssue3941(t *testing.T) {
+	skipIfGccgo(t, "gccgo does not support -ldflags -X")
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -2091,6 +2239,7 @@
 }
 
 func TestGoTestCpuprofileLeavesBinaryBehind(t *testing.T) {
+	skipIfGccgo(t, "gccgo has no standard packages")
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -2113,6 +2262,7 @@
 }
 
 func TestGoTestMutexprofileLeavesBinaryBehind(t *testing.T) {
+	skipIfGccgo(t, "gccgo has no standard packages")
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -2124,6 +2274,7 @@
 }
 
 func TestGoTestMutexprofileDashOControlsBinaryLocation(t *testing.T) {
+	skipIfGccgo(t, "gccgo has no standard packages")
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -2145,6 +2296,7 @@
 }
 
 func TestGoTestDashCDashOControlsBinaryLocation(t *testing.T) {
+	skipIfGccgo(t, "gccgo has no standard packages")
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -2165,6 +2317,7 @@
 }
 
 func TestGoTestDashIDashOWritesBinary(t *testing.T) {
+	skipIfGccgo(t, "gccgo has no standard packages")
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -2388,6 +2541,7 @@
 }
 
 func TestShadowingLogic(t *testing.T) {
+	skipIfGccgo(t, "gccgo has no standard packages")
 	tg := testgo(t)
 	defer tg.cleanup()
 	pwd := tg.pwd()
@@ -2620,6 +2774,17 @@
 	tg.grepStdoutNot(`\tf\t*[0-9]`, "reported coverage for assembly function f")
 }
 
+// Issue 24588.
+func TestCoverageDashC(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.makeTempdir()
+	tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
+	tg.run("test", "-c", "-o", tg.path("coverdep"), "-coverprofile="+tg.path("no/such/dir/cover.out"), "coverdep")
+	tg.wantExecutable(tg.path("coverdep"), "go -test -c -coverprofile did not create executable")
+}
+
 func TestPluginNonMain(t *testing.T) {
 	wd, err := os.Getwd()
 	if err != nil {
@@ -2829,7 +2994,7 @@
 	// OpenBSD's pkg-config is strict about whitespace and only
 	// supports backslash-escaped whitespace. It does not support
 	// quotes, which the normal freedesktop.org pkg-config does
-	// support. See http://man.openbsd.org/pkg-config.1
+	// support. See https://man.openbsd.org/pkg-config.1
 	tg.tempFile("foo.pc", `
 Name: foo
 Description: The foo library
@@ -2863,6 +3028,7 @@
 // "go test -c" should also appear to write a new binary every time,
 // even if it's really just updating the mtime on an existing up-to-date binary.
 func TestIssue6480(t *testing.T) {
+	skipIfGccgo(t, "gccgo has no standard packages")
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -3106,6 +3272,43 @@
 	tg.grepStdout("File with non-runnable example was built.", "file with non-runnable example was not built")
 }
 
+// issue 24570
+func TestGoTestCoverMultiPackage(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.run("test", "-cover", "./testdata/testcover/...")
+	tg.grepStdout(`\?.*testdata/testcover/pkg1.*(\d\.\d\d\ds|cached).*coverage:.*0\.0% of statements \[no test files\]`, "expected [no test files] for pkg1")
+	tg.grepStdout(`ok.*testdata/testcover/pkg2.*(\d\.\d\d\ds|cached).*coverage:.*0\.0% of statements \[no tests to run\]`, "expected [no tests to run] for pkg2")
+	tg.grepStdout(`ok.*testdata/testcover/pkg3.*(\d\.\d\d\ds|cached).*coverage:.*100\.0% of statements`, "expected 100% coverage for pkg3")
+}
+
+// issue 24570
+func TestGoTestCoverprofileMultiPackage(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.creatingTemp("testdata/cover.out")
+	tg.run("test", "-coverprofile=testdata/cover.out", "./testdata/testcover/...")
+	tg.grepStdout(`\?.*testdata/testcover/pkg1.*(\d\.\d\d\ds|cached).*coverage:.*0\.0% of statements \[no test files\]`, "expected [no test files] for pkg1")
+	tg.grepStdout(`ok.*testdata/testcover/pkg2.*(\d\.\d\d\ds|cached).*coverage:.*0\.0% of statements \[no tests to run\]`, "expected [no tests to run] for pkg2")
+	tg.grepStdout(`ok.*testdata/testcover/pkg3.*(\d\.\d\d\ds|cached).*coverage:.*100\.0% of statements`, "expected 100% coverage for pkg3")
+	if out, err := ioutil.ReadFile("testdata/cover.out"); err != nil {
+		t.Error(err)
+	} else {
+		if !bytes.Contains(out, []byte("mode: set")) {
+			t.Errorf(`missing "mode: set" in %s`, out)
+		}
+		if !bytes.Contains(out, []byte(`pkg1/a.go:5.10,7.2 1 0`)) && !bytes.Contains(out, []byte(`pkg1\a.go:5.10,7.2 1 0`)) {
+			t.Errorf(`missing "pkg1/a.go:5.10,7.2 1 0" in %s`, out)
+		}
+		if !bytes.Contains(out, []byte(`pkg2/a.go:5.10,7.2 1 0`)) && !bytes.Contains(out, []byte(`pkg2\a.go:5.10,7.2 1 0`)) {
+			t.Errorf(`missing "pkg2/a.go:5.10,7.2 1 0" in %s`, out)
+		}
+		if !bytes.Contains(out, []byte(`pkg3/a.go:5.10,7.2 1 1`)) && !bytes.Contains(out, []byte(`pkg3\a.go:5.10,7.2 1 1`)) {
+			t.Errorf(`missing "pkg3/a.go:5.10,7.2 1 1" in %s`, out)
+		}
+	}
+}
+
 func TestGoGenerateHandlesSimpleCommand(t *testing.T) {
 	if runtime.GOOS == "windows" {
 		t.Skip("skipping because windows has no echo command")
@@ -3166,6 +3369,22 @@
 	}
 }
 
+func TestGoGenerateXTestPkgName(t *testing.T) {
+	if runtime.GOOS == "windows" {
+		t.Skip("skipping because windows has no echo command")
+	}
+
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.tempFile("env_test.go", "package main_test\n\n//go:generate echo $GOPACKAGE")
+	tg.run("generate", tg.path("env_test.go"))
+	want := "main_test"
+	if got := strings.TrimSpace(tg.getStdout()); got != want {
+		t.Errorf("go generate in XTest file got package name %q; want %q", got, want)
+	}
+}
+
 func TestGoGenerateBadImports(t *testing.T) {
 	if runtime.GOOS == "windows" {
 		t.Skip("skipping because windows has no echo command")
@@ -3203,6 +3422,8 @@
 }
 
 func TestGoVetWithExternalTests(t *testing.T) {
+	t.Skip("vgo")
+
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.makeTempdir()
@@ -3212,6 +3433,8 @@
 }
 
 func TestGoVetWithTags(t *testing.T) {
+	t.Skip("vgo")
+
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.makeTempdir()
@@ -3221,6 +3444,8 @@
 }
 
 func TestGoVetWithFlagsOn(t *testing.T) {
+	t.Skip("vgo")
+
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.makeTempdir()
@@ -3247,6 +3472,20 @@
 	tg.run("vet", "p")
 }
 
+// Issue 24193.
+func TestVetWithOnlyCgoFiles(t *testing.T) {
+	if !canCgo {
+		t.Skip("skipping because cgo not enabled")
+	}
+
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.tempFile("src/p/p.go", "package p; import \"C\"; func F() {}")
+	tg.setenv("GOPATH", tg.path("."))
+	tg.run("vet", "p")
+}
+
 // Issue 9767, 19769.
 func TestGoGetDotSlashDownload(t *testing.T) {
 	testenv.MustHaveExternalNetwork(t)
@@ -3563,6 +3802,40 @@
 	tg.run("get", "-d", "-u", "-f", "-insecure", pkg)
 }
 
+func TestGoGetUpdateUnknownProtocol(t *testing.T) {
+	testenv.MustHaveExternalNetwork(t)
+
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.makeTempdir()
+	tg.setenv("GOPATH", tg.path("."))
+
+	const repo = "github.com/golang/example"
+
+	// Clone the repo via HTTPS manually.
+	repoDir := tg.path("src/" + repo)
+	cmd := exec.Command("git", "clone", "-q", "https://"+repo, repoDir)
+	if out, err := cmd.CombinedOutput(); err != nil {
+		t.Fatalf("cloning %v repo: %v\n%s", repo, err, out)
+	}
+
+	// Configure the repo to use a protocol unknown to cmd/go
+	// that still actually works.
+	cmd = exec.Command("git", "remote", "set-url", "origin", "xyz://"+repo)
+	cmd.Dir = repoDir
+	if out, err := cmd.CombinedOutput(); err != nil {
+		t.Fatalf("git remote set-url: %v\n%s", err, out)
+	}
+	cmd = exec.Command("git", "config", "--local", "url.https://github.com/.insteadOf", "xyz://github.com/")
+	cmd.Dir = repoDir
+	if out, err := cmd.CombinedOutput(); err != nil {
+		t.Fatalf("git config: %v\n%s", err, out)
+	}
+
+	// We need -f to ignore import comments.
+	tg.run("get", "-d", "-u", "-f", repo+"/hello")
+}
+
 func TestGoGetInsecureCustomDomain(t *testing.T) {
 	testenv.MustHaveExternalNetwork(t)
 
@@ -3587,6 +3860,7 @@
 }
 
 func TestGoInstallPkgdir(t *testing.T) {
+	skipIfGccgo(t, "gccgo has no standard packages")
 	tooSlow(t)
 
 	tg := testgo(t)
@@ -3834,6 +4108,7 @@
 }
 
 func TestGoBuildOutput(t *testing.T) {
+	skipIfGccgo(t, "gccgo has no standard packages")
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -4341,6 +4616,7 @@
 
 func TestLinkXImportPathEscape(t *testing.T) {
 	// golang.org/issue/16710
+	skipIfGccgo(t, "gccgo does not support -ldflags -X")
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.parallel()
@@ -4370,6 +4646,7 @@
 // Issue 18225.
 // This is really a cmd/asm issue but this is a convenient place to test it.
 func TestConcurrentAsm(t *testing.T) {
+	skipIfGccgo(t, "gccgo does not use cmd/asm")
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.parallel()
@@ -4435,6 +4712,7 @@
 // Issue 19198.
 // This is really a cmd/link issue but this is a convenient place to test it.
 func TestDuplicateGlobalAsmSymbols(t *testing.T) {
+	skipIfGccgo(t, "gccgo does not use cmd/asm")
 	tooSlow(t)
 	if runtime.GOARCH != "386" && runtime.GOARCH != "amd64" {
 		t.Skipf("skipping test on %s", runtime.GOARCH)
@@ -4478,6 +4756,7 @@
 }
 
 func TestBuildTagsNoComma(t *testing.T) {
+	skipIfGccgo(t, "gccgo has no standard packages")
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.makeTempdir()
@@ -4508,6 +4787,9 @@
 }
 
 func TestExecutableGOROOT(t *testing.T) {
+	t.Skip("vgo")
+
+	skipIfGccgo(t, "gccgo has no GOROOT")
 	if runtime.GOOS == "openbsd" {
 		t.Skipf("test case does not work on %s, missing os.Executable", runtime.GOOS)
 	}
@@ -4562,7 +4844,6 @@
 	// so it should find the new tree.
 	tg.tempDir("new/pkg/tool")
 	t.Run("RelocatedTree", func(t *testing.T) {
-		t.Skip("vgo detects fake GOROOT")
 		check(t, newGoTool, newRoot)
 	})
 
@@ -4571,7 +4852,6 @@
 
 	// Symlink into go tree should still find go tree.
 	t.Run("SymlinkedExe", func(t *testing.T) {
-		t.Skip("vgo detects fake GOROOT")
 		testenv.MustHaveSymlink(t)
 		if err := os.Symlink(newGoTool, symGoTool); err != nil {
 			t.Fatal(err)
@@ -4618,6 +4898,7 @@
 }
 
 func TestNeedVersion(t *testing.T) {
+	skipIfGccgo(t, "gccgo does not use cmd/compile")
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.parallel()
@@ -4630,6 +4911,7 @@
 
 // Test that user can override default code generation flags.
 func TestUserOverrideFlags(t *testing.T) {
+	skipIfGccgo(t, "gccgo does not use -gcflags")
 	if !canCgo {
 		t.Skip("skipping because cgo not enabled")
 	}
@@ -4701,8 +4983,6 @@
 
 // Issue 9737: verify that GOARM and GO386 affect the computed build ID.
 func TestBuildIDContainsArchModeEnv(t *testing.T) {
-	t.Skip("broken in standard distribution")
-
 	if testing.Short() {
 		t.Skip("skipping in short mode")
 	}
@@ -4721,7 +5001,7 @@
 			before()
 			tg.run("install", "mycmd")
 			after()
-			tg.wantStale("mycmd", "stale dependency: runtime/internal/sys", "should be stale after environment variable change")
+			tg.wantStale("mycmd", "stale dependency", "should be stale after environment variable change")
 		}
 	}
 
@@ -4741,6 +5021,8 @@
 }
 
 func TestTestRegexps(t *testing.T) {
+	t.Skip("vgo") // fails with Go 1.10 testing package
+
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
@@ -4762,34 +5044,34 @@
 	//	BenchmarkX/Y is run in full, twice
 	want := `=== RUN   TestX
 === RUN   TestX/Y
-	x_test.go:6: LOG: X running
-    	x_test.go:8: LOG: Y running
+    x_test.go:6: LOG: X running
+        x_test.go:8: LOG: Y running
 === RUN   TestXX
-	z_test.go:10: LOG: XX running
+    z_test.go:10: LOG: XX running
 === RUN   TestX
 === RUN   TestX/Y
-	x_test.go:6: LOG: X running
-    	x_test.go:8: LOG: Y running
+    x_test.go:6: LOG: X running
+        x_test.go:8: LOG: Y running
 === RUN   TestXX
-	z_test.go:10: LOG: XX running
+    z_test.go:10: LOG: XX running
 --- BENCH: BenchmarkX/Y
-	x_test.go:15: LOG: Y running N=1
-	x_test.go:15: LOG: Y running N=100
-	x_test.go:15: LOG: Y running N=10000
-	x_test.go:15: LOG: Y running N=1000000
-	x_test.go:15: LOG: Y running N=100000000
-	x_test.go:15: LOG: Y running N=2000000000
+    x_test.go:15: LOG: Y running N=1
+    x_test.go:15: LOG: Y running N=100
+    x_test.go:15: LOG: Y running N=10000
+    x_test.go:15: LOG: Y running N=1000000
+    x_test.go:15: LOG: Y running N=100000000
+    x_test.go:15: LOG: Y running N=2000000000
 --- BENCH: BenchmarkX/Y
-	x_test.go:15: LOG: Y running N=1
-	x_test.go:15: LOG: Y running N=100
-	x_test.go:15: LOG: Y running N=10000
-	x_test.go:15: LOG: Y running N=1000000
-	x_test.go:15: LOG: Y running N=100000000
-	x_test.go:15: LOG: Y running N=2000000000
+    x_test.go:15: LOG: Y running N=1
+    x_test.go:15: LOG: Y running N=100
+    x_test.go:15: LOG: Y running N=10000
+    x_test.go:15: LOG: Y running N=1000000
+    x_test.go:15: LOG: Y running N=100000000
+    x_test.go:15: LOG: Y running N=2000000000
 --- BENCH: BenchmarkX
-	x_test.go:13: LOG: X running N=1
+    x_test.go:13: LOG: X running N=1
 --- BENCH: BenchmarkXX
-	z_test.go:18: LOG: XX running N=1
+    z_test.go:18: LOG: XX running N=1
 `
 
 	have := strings.Join(lines, "")
@@ -4820,14 +5102,12 @@
 	if testing.Short() && testenv.Builder() == "" {
 		t.Skipf("skipping in -short mode on non-builder")
 	}
-	if runtime.Compiler == "gccgo" {
-		t.Skipf("skipping test because buildmode=pie is not supported on gccgo")
-	}
 
 	platform := fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)
 	switch platform {
 	case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x",
-		"android/amd64", "android/arm", "android/arm64", "android/386":
+		"android/amd64", "android/arm", "android/arm64", "android/386",
+		"freebsd/amd64":
 	case "darwin/amd64":
 	default:
 		t.Skipf("skipping test because buildmode=pie is not supported on %s", platform)
@@ -4842,7 +5122,7 @@
 	tg.run("build", "-buildmode=pie", "-o", obj, src)
 
 	switch runtime.GOOS {
-	case "linux", "android":
+	case "linux", "android", "freebsd":
 		f, err := elf.Open(obj)
 		if err != nil {
 			t.Fatal(err)
@@ -4943,6 +5223,7 @@
 }
 
 func TestWrongGOOSErrorBeforeLoadError(t *testing.T) {
+	skipIfGccgo(t, "gccgo assumes cross-compilation is always possible")
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
@@ -4952,7 +5233,8 @@
 }
 
 func TestUpxCompression(t *testing.T) {
-	if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" {
+	if runtime.GOOS != "linux" ||
+		(runtime.GOARCH != "amd64" && runtime.GOARCH != "386") {
 		t.Skipf("skipping upx test on %s/%s", runtime.GOOS, runtime.GOARCH)
 	}
 
@@ -5005,6 +5287,49 @@
 	}
 }
 
+// Test that Go binaries can be run under QEMU in user-emulation mode
+// (See issue #13024).
+func TestQEMUUserMode(t *testing.T) {
+	if testing.Short() && testenv.Builder() == "" {
+		t.Skipf("skipping in -short mode on non-builder")
+	}
+
+	testArchs := []struct {
+		g, qemu string
+	}{
+		{"arm", "arm"},
+		{"arm64", "aarch64"},
+	}
+
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.tempFile("main.go", `package main; import "fmt"; func main() { fmt.Print("hello qemu-user") }`)
+	tg.parallel()
+	src, obj := tg.path("main.go"), tg.path("main")
+
+	for _, arch := range testArchs {
+		out, err := exec.Command("qemu-"+arch.qemu, "--version").CombinedOutput()
+		if err != nil {
+			t.Logf("Skipping %s test (qemu-%s not available)", arch.g, arch.qemu)
+			continue
+		}
+
+		tg.setenv("GOARCH", arch.g)
+		tg.run("build", "-o", obj, src)
+
+		out, err = exec.Command("qemu-"+arch.qemu, obj).CombinedOutput()
+		if err != nil {
+			t.Logf("qemu-%s output:\n%s\n", arch.qemu, out)
+			t.Errorf("qemu-%s failed with %v", arch.qemu, err)
+			continue
+		}
+		if want := "hello qemu-user"; string(out) != want {
+			t.Errorf("bad output from qemu-%s:\ngot %s; want %s", arch.qemu, out, want)
+		}
+	}
+
+}
+
 func TestGOTMPDIR(t *testing.T) {
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -5080,6 +5405,28 @@
 	}
 }
 
+func TestCacheListStale(t *testing.T) {
+	tooSlow(t)
+	if strings.Contains(os.Getenv("GODEBUG"), "gocacheverify") {
+		t.Skip("GODEBUG gocacheverify")
+	}
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.makeTempdir()
+	tg.setenv("GOCACHE", tg.path("cache"))
+	tg.tempFile("gopath/src/p/p.go", "package p; import _ \"q\"; func F(){}\n")
+	tg.tempFile("gopath/src/q/q.go", "package q; func F(){}\n")
+	tg.tempFile("gopath/src/m/m.go", "package main; import _ \"q\"; func main(){}\n")
+
+	tg.setenv("GOPATH", tg.path("gopath"))
+	tg.run("install", "p", "m")
+	tg.run("list", "-f={{.ImportPath}} {{.Stale}}", "m", "q", "p")
+	tg.grepStdout("^m false", "m should not be stale")
+	tg.grepStdout("^q true", "q should be stale")
+	tg.grepStdout("^p false", "p should not be stale")
+}
+
 func TestCacheCoverage(t *testing.T) {
 	tooSlow(t)
 
@@ -5098,6 +5445,31 @@
 	tg.run("test", "-cover", "-short", "math", "strings")
 }
 
+func TestCacheVet(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+
+	if strings.Contains(os.Getenv("GODEBUG"), "gocacheverify") {
+		t.Skip("GODEBUG gocacheverify")
+	}
+	if os.Getenv("GOCACHE") == "off" {
+		tooSlow(t)
+		tg.makeTempdir()
+		tg.setenv("GOCACHE", tg.path("cache"))
+	}
+
+	// Check that second vet reuses cgo-derived inputs.
+	// The first command could be build instead of vet,
+	// except that if the cache is empty and there's a net.a
+	// in GOROOT/pkg, the build will not bother to regenerate
+	// and cache the cgo outputs, whereas vet always will.
+	tg.run("vet", "os/user")
+	tg.run("vet", "-x", "os/user")
+	tg.grepStderrNot(`^(clang|gcc)`, "should not have run compiler")
+	tg.grepStderrNot(`[\\/]cgo `, "should not have run cgo")
+}
+
 func TestIssue22588(t *testing.T) {
 	// Don't get confused by stderr coming from tools.
 	tg := testgo(t)
@@ -5184,27 +5556,29 @@
 	tg.setenv("GOPATH", tg.tempdir)
 	tg.setenv("GOCACHE", tg.path("cache"))
 
-	// timeout here should not affect result being cached
-	// or being retrieved later.
-	tg.run("test", "-x", "-timeout=10s", "errors")
-	tg.grepStderr(`[\\/]compile|gccgo`, "did not run compiler")
-	tg.grepStderr(`[\\/]link|gccgo`, "did not run linker")
-	tg.grepStderr(`errors\.test`, "did not run test")
+	if runtime.Compiler != "gccgo" {
+		// timeout here should not affect result being cached
+		// or being retrieved later.
+		tg.run("test", "-x", "-timeout=10s", "errors")
+		tg.grepStderr(`[\\/]compile|gccgo`, "did not run compiler")
+		tg.grepStderr(`[\\/]link|gccgo`, "did not run linker")
+		tg.grepStderr(`errors\.test`, "did not run test")
 
-	tg.run("test", "-x", "errors")
-	tg.grepStdout(`ok  \terrors\t\(cached\)`, "did not report cached result")
-	tg.grepStderrNot(`[\\/]compile|gccgo`, "incorrectly ran compiler")
-	tg.grepStderrNot(`[\\/]link|gccgo`, "incorrectly ran linker")
-	tg.grepStderrNot(`errors\.test`, "incorrectly ran test")
-	tg.grepStderrNot("DO NOT USE", "poisoned action status leaked")
+		tg.run("test", "-x", "errors")
+		tg.grepStdout(`ok  \terrors\t\(cached\)`, "did not report cached result")
+		tg.grepStderrNot(`[\\/]compile|gccgo`, "incorrectly ran compiler")
+		tg.grepStderrNot(`[\\/]link|gccgo`, "incorrectly ran linker")
+		tg.grepStderrNot(`errors\.test`, "incorrectly ran test")
+		tg.grepStderrNot("DO NOT USE", "poisoned action status leaked")
 
-	// Even very low timeouts do not disqualify cached entries.
-	tg.run("test", "-timeout=1ns", "-x", "errors")
-	tg.grepStderrNot(`errors\.test`, "incorrectly ran test")
+		// Even very low timeouts do not disqualify cached entries.
+		tg.run("test", "-timeout=1ns", "-x", "errors")
+		tg.grepStderrNot(`errors\.test`, "incorrectly ran test")
 
-	tg.run("clean", "-testcache")
-	tg.run("test", "-x", "errors")
-	tg.grepStderr(`errors\.test`, "did not run test")
+		tg.run("clean", "-testcache")
+		tg.run("test", "-x", "errors")
+		tg.grepStderr(`errors\.test`, "did not run test")
+	}
 
 	// The -p=1 in the commands below just makes the -x output easier to read.
 
@@ -5225,8 +5599,8 @@
 	tg.grepStdout(`ok  \tt/t2\t\(cached\)`, "did not cache t2")
 	tg.grepStdout(`ok  \tt/t3\t\(cached\)`, "did not cache t3")
 	tg.grepStdout(`ok  \tt/t4\t\(cached\)`, "did not cache t4")
-	tg.grepStderrNot(`[\\/]compile|gccgo`, "incorrectly ran compiler")
-	tg.grepStderrNot(`[\\/]link|gccgo`, "incorrectly ran linker")
+	tg.grepStderrNot(`[\\/](compile|gccgo) `, "incorrectly ran compiler")
+	tg.grepStderrNot(`[\\/](link|gccgo) `, "incorrectly ran linker")
 	tg.grepStderrNot(`p[0-9]\.test`, "incorrectly ran test")
 
 	t.Log("\n\nCOMMENT\n\n")
@@ -5239,8 +5613,8 @@
 	tg.grepStdout(`ok  \tt/t2\t\(cached\)`, "did not cache t2")
 	tg.grepStdout(`ok  \tt/t3\t\(cached\)`, "did not cache t3")
 	tg.grepStdout(`ok  \tt/t4\t\(cached\)`, "did not cache t4")
-	tg.grepStderrNot(`([\\/]compile|gccgo).*t[0-9]_test\.go`, "incorrectly ran compiler")
-	tg.grepStderrNot(`[\\/]link|gccgo`, "incorrectly ran linker")
+	tg.grepStderrNot(`([\\/](compile|gccgo) ).*t[0-9]_test\.go`, "incorrectly ran compiler")
+	tg.grepStderrNot(`[\\/](link|gccgo) `, "incorrectly ran linker")
 	tg.grepStderrNot(`t[0-9]\.test.*test\.short`, "incorrectly ran test")
 
 	t.Log("\n\nCHANGE\n\n")
@@ -5262,7 +5636,11 @@
 	// so the test should not have been rerun.
 	tg.grepStderr(`([\\/]compile|gccgo).*t2_test.go`, "did not recompile t2")
 	tg.grepStderr(`([\\/]link|gccgo).*t2\.test`, "did not relink t2_test")
-	tg.grepStdout(`ok  \tt/t2\t\(cached\)`, "did not cache t/t2")
+	// This check does not currently work with gccgo, as garbage
+	// collection of unused variables is not turned on by default.
+	if runtime.Compiler != "gccgo" {
+		tg.grepStdout(`ok  \tt/t2\t\(cached\)`, "did not cache t/t2")
+	}
 
 	// t3 imports p1, and changing X changes t3's test binary.
 	tg.grepStderr(`([\\/]compile|gccgo).*t3_test.go`, "did not recompile t3")
@@ -5274,7 +5652,11 @@
 	// and not rerun.
 	tg.grepStderrNot(`([\\/]compile|gccgo).*t4_test.go`, "incorrectly recompiled t4")
 	tg.grepStderr(`([\\/]link|gccgo).*t4\.test`, "did not relink t4_test")
-	tg.grepStdout(`ok  \tt/t4\t\(cached\)`, "did not cache t/t4")
+	// This check does not currently work with gccgo, as garbage
+	// collection of unused variables is not turned on by default.
+	if runtime.Compiler != "gccgo" {
+		tg.grepStdout(`ok  \tt/t4\t\(cached\)`, "did not cache t/t4")
+	}
 }
 
 func TestTestCacheInputs(t *testing.T) {
@@ -5418,6 +5800,8 @@
 }
 
 func TestTestVet(t *testing.T) {
+	t.Skip("vgo")
+
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -5459,7 +5843,7 @@
 	tg.grepStdout(`ok\s+vetfail/p2`, "did not run vetfail/p2")
 }
 
-func TestTestRebuild(t *testing.T) {
+func TestTestVetRebuild(t *testing.T) {
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.parallel()
@@ -5495,6 +5879,7 @@
 
 	tg.setenv("GOPATH", tg.path("."))
 	tg.run("test", "b")
+	tg.run("vet", "b")
 }
 
 func TestInstallDeps(t *testing.T) {
@@ -5557,6 +5942,7 @@
 }
 
 func TestGcflagsPatterns(t *testing.T) {
+	skipIfGccgo(t, "gccgo has no standard packages")
 	tg := testgo(t)
 	defer tg.cleanup()
 	tg.setenv("GOPATH", "")
@@ -5595,6 +5981,7 @@
 }
 
 func TestGoTestJSON(t *testing.T) {
+	skipIfGccgo(t, "gccgo does not have standard packages")
 	tooSlow(t)
 
 	tg := testgo(t)
@@ -5632,6 +6019,8 @@
 }
 
 func TestFailFast(t *testing.T) {
+	t.Skip("vgo") // fails with Go 1.10 testing package
+
 	tooSlow(t)
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -5661,6 +6050,9 @@
 		// non-parallel subtests:
 		{"TestFailingSubtestsA", true, 1},
 		{"TestFailingSubtestsA", false, 2},
+		// fatal test
+		{"TestFatal[CD]", true, 1},
+		{"TestFatal[CD]", false, 2},
 	}
 
 	for _, tt := range tests {
@@ -5760,6 +6152,21 @@
 	}
 }
 
+// Issue 23882.
+func TestCoverpkgAllRuntime(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+
+	tg.tempFile("src/x/x.go", `package x; import _ "runtime"; func F() {}`)
+	tg.tempFile("src/x/x_test.go", `package x; import "testing"; func TestF(t *testing.T) { F() }`)
+	tg.setenv("GOPATH", tg.path("."))
+	tg.run("test", "-coverpkg=all", "x")
+	if canRace {
+		tg.run("test", "-coverpkg=all", "-race", "x")
+	}
+}
+
 func TestBadCommandLines(t *testing.T) {
 	tg := testgo(t)
 	defer tg.cleanup()
@@ -5779,7 +6186,11 @@
 	tg.grepStderr("invalid input file name \"-y.go\"", "did not reject -y.go")
 	tg.must(os.Remove(tg.path("src/x/-y.go")))
 
-	tg.runFail("build", "-gcflags=all=@x", "x")
+	if runtime.Compiler == "gccgo" {
+		tg.runFail("build", "-gccgoflags=all=@x", "x")
+	} else {
+		tg.runFail("build", "-gcflags=all=@x", "x")
+	}
 	tg.grepStderr("invalid command-line argument @x in command", "did not reject @x during exec")
 
 	tg.tempFile("src/@x/x.go", "package x\n")
@@ -5813,14 +6224,16 @@
 	tg.tempFile("src/x/x.go", "package x\n")
 	tg.setenv("GOPATH", tg.path("."))
 
-	tg.tempFile("src/x/x.go", `package x
+	if runtime.Compiler == "gc" {
+		tg.tempFile("src/x/x.go", `package x
 
-		//go:cgo_ldflag "-fplugin=foo.so"
+			//go:cgo_ldflag "-fplugin=foo.so"
 
-		import "C"
-	`)
-	tg.runFail("build", "x")
-	tg.grepStderr("//go:cgo_ldflag .* only allowed in cgo-generated code", "did not reject //go:cgo_ldflag directive")
+			import "C"
+		`)
+		tg.runFail("build", "x")
+		tg.grepStderr("//go:cgo_ldflag .* only allowed in cgo-generated code", "did not reject //go:cgo_ldflag directive")
+	}
 
 	tg.must(os.Remove(tg.path("src/x/x.go")))
 	tg.runFail("build", "x")
@@ -5834,11 +6247,14 @@
 	tg.runFail("build", "x")
 	tg.grepStderr("no Go files", "did not report missing source code") // _* files are ignored...
 
-	tg.runFail("build", tg.path("src/x/_cgo_yy.go")) // ... but if forced, the comment is rejected
-	// Actually, today there is a separate issue that _ files named
-	// on the command-line are ignored. Once that is fixed,
-	// we want to see the cgo_ldflag error.
-	tg.grepStderr("//go:cgo_ldflag only allowed in cgo-generated code|no Go files", "did not reject //go:cgo_ldflag directive")
+	if runtime.Compiler == "gc" {
+		tg.runFail("build", tg.path("src/x/_cgo_yy.go")) // ... but if forced, the comment is rejected
+		// Actually, today there is a separate issue that _ files named
+		// on the command-line are ignored. Once that is fixed,
+		// we want to see the cgo_ldflag error.
+		tg.grepStderr("//go:cgo_ldflag only allowed in cgo-generated code|no Go files", "did not reject //go:cgo_ldflag directive")
+	}
+
 	tg.must(os.Remove(tg.path("src/x/_cgo_yy.go")))
 
 	tg.tempFile("src/x/x.go", "package x\n")
@@ -5908,3 +6324,175 @@
 	tg.run("build", "-n", "x")
 	tg.grepStderr("-D@foo", "did not find -D@foo in commands")
 }
+
+func TestTwoPkgConfigs(t *testing.T) {
+	if !canCgo {
+		t.Skip("no cgo")
+	}
+	if runtime.GOOS == "windows" || runtime.GOOS == "plan9" {
+		t.Skipf("no shell scripts on %s", runtime.GOOS)
+	}
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.tempFile("src/x/a.go", `package x
+		// #cgo pkg-config: --static a
+		import "C"
+	`)
+	tg.tempFile("src/x/b.go", `package x
+		// #cgo pkg-config: --static a
+		import "C"
+	`)
+	tg.tempFile("pkg-config.sh", `#!/bin/sh
+echo $* >>`+tg.path("pkg-config.out"))
+	tg.must(os.Chmod(tg.path("pkg-config.sh"), 0755))
+	tg.setenv("GOPATH", tg.path("."))
+	tg.setenv("PKG_CONFIG", tg.path("pkg-config.sh"))
+	tg.run("build", "x")
+	out, err := ioutil.ReadFile(tg.path("pkg-config.out"))
+	tg.must(err)
+	out = bytes.TrimSpace(out)
+	want := "--cflags --static --static -- a a\n--libs --static --static -- a a"
+	if !bytes.Equal(out, []byte(want)) {
+		t.Errorf("got %q want %q", out, want)
+	}
+}
+
+// Issue 23982
+func TestFilepathUnderCwdFormat(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.run("test", "-x", "-cover", "log")
+	tg.grepStderrNot(`\.log\.cover\.go`, "-x output should contain correctly formatted filepath under cwd")
+}
+
+// Issue 24396.
+func TestDontReportRemoveOfEmptyDir(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.tempFile("src/a/a.go", `package a`)
+	tg.setenv("GOPATH", tg.path("."))
+	tg.run("install", "-x", "a")
+	tg.run("install", "-x", "a")
+	// The second install should have printed only a WORK= line,
+	// nothing else.
+	if bytes.Count(tg.stdout.Bytes(), []byte{'\n'})+bytes.Count(tg.stderr.Bytes(), []byte{'\n'}) > 1 {
+		t.Error("unnecessary output when installing installed package")
+	}
+}
+
+// Issue 23264.
+func TestNoRelativeTmpdir(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+
+	tg.tempFile("src/a/a.go", `package a`)
+	tg.cd(tg.path("."))
+	tg.must(os.Mkdir("tmp", 0777))
+
+	tg.setenv("GOCACHE", "off")
+	tg.setenv("GOPATH", tg.path("."))
+	tg.setenv("GOTMPDIR", "tmp")
+	tg.runFail("build", "a")
+	tg.grepStderr("relative tmpdir", "wrong error")
+
+	if runtime.GOOS != "windows" && runtime.GOOS != "plan9" {
+		tg.unsetenv("GOTMPDIR")
+		tg.setenv("TMPDIR", "tmp")
+		tg.runFail("build", "a")
+		tg.grepStderr("relative tmpdir", "wrong error")
+	}
+}
+
+// Issue 24704.
+func TestLinkerTmpDirIsDeleted(t *testing.T) {
+	if !canCgo {
+		t.Skip("skipping because cgo not enabled")
+	}
+
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.tempFile("a.go", `package main; import "C"; func main() {}`)
+	tg.run("build", "-ldflags", "-v", "-o", os.DevNull, tg.path("a.go"))
+	// Find line that has "host link:" in linker output.
+	stderr := tg.getStderr()
+	var hostLinkLine string
+	for _, line := range strings.Split(stderr, "\n") {
+		if !strings.Contains(line, "host link:") {
+			continue
+		}
+		hostLinkLine = line
+		break
+	}
+	if hostLinkLine == "" {
+		t.Fatal(`fail to find with "host link:" string in linker output`)
+	}
+	// Find parameter, like "/tmp/go-link-408556474/go.o" inside of
+	// "host link:" line, and extract temp directory /tmp/go-link-408556474
+	// out of it.
+	tmpdir := hostLinkLine
+	i := strings.Index(tmpdir, `go.o"`)
+	if i == -1 {
+		t.Fatalf(`fail to find "go.o" in "host link:" line %q`, hostLinkLine)
+	}
+	tmpdir = tmpdir[:i-1]
+	i = strings.LastIndex(tmpdir, `"`)
+	if i == -1 {
+		t.Fatalf(`fail to find " in "host link:" line %q`, hostLinkLine)
+	}
+	tmpdir = tmpdir[i+1:]
+	// Verify that temp directory has been removed.
+	_, err := os.Stat(tmpdir)
+	if err == nil {
+		t.Fatalf("temp directory %q has not been removed", tmpdir)
+	}
+	if !os.IsNotExist(err) {
+		t.Fatalf("Stat(%q) returns unexpected error: %v", tmpdir, err)
+	}
+}
+
+func testCDAndGOPATHAreDifferent(tg *testgoData, cd, gopath string) {
+	tg.setenv("GOPATH", gopath)
+
+	tg.tempDir("dir")
+	exe := tg.path("dir/a.exe")
+
+	tg.cd(cd)
+
+	tg.run("build", "-o", exe, "-ldflags", "-X=my.pkg.Text=linkXworked")
+	out, err := exec.Command(exe).CombinedOutput()
+	if err != nil {
+		tg.t.Fatal(err)
+	}
+	if string(out) != "linkXworked\n" {
+		tg.t.Errorf(`incorrect output with GOPATH=%q and CD=%q: expected "linkXworked\n", but have %q`, gopath, cd, string(out))
+	}
+}
+
+func TestCDAndGOPATHAreDifferent(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+
+	gopath := filepath.Join(tg.pwd(), "testdata")
+	cd := filepath.Join(gopath, "src/my.pkg/main")
+
+	testCDAndGOPATHAreDifferent(tg, cd, gopath)
+	if runtime.GOOS == "windows" {
+		testCDAndGOPATHAreDifferent(tg, cd, strings.Replace(gopath, `\`, `/`, -1))
+		testCDAndGOPATHAreDifferent(tg, cd, strings.ToUpper(gopath))
+		testCDAndGOPATHAreDifferent(tg, cd, strings.ToLower(gopath))
+	}
+}
+
+// Issue 25579.
+func TestGoBuildDashODevNull(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.parallel()
+	tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
+	tg.run("build", "-o", os.DevNull, filepath.Join(tg.pwd(), "testdata", "src", "hello", "hello.go"))
+	tg.mustNotExist("hello")
+	tg.mustNotExist("hello.exe")
+}
diff --git a/vendor/cmd/go/internal/base/signal_unix.go b/vendor/cmd/go/internal/base/signal_unix.go
index 4ca3da9..38490b5 100644
--- a/vendor/cmd/go/internal/base/signal_unix.go
+++ b/vendor/cmd/go/internal/base/signal_unix.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
+// +build darwin dragonfly freebsd js linux nacl netbsd openbsd solaris
 
 package base
 
diff --git a/vendor/cmd/go/internal/cache/cache.go b/vendor/cmd/go/internal/cache/cache.go
index edb5882..0cf0155 100644
--- a/vendor/cmd/go/internal/cache/cache.go
+++ b/vendor/cmd/go/internal/cache/cache.go
@@ -189,6 +189,21 @@
 	return Entry{buf, size, time.Unix(0, tm)}, nil
 }
 
+// GetFile looks up the action ID in the cache and returns
+// the name of the corresponding data file.
+func (c *Cache) GetFile(id ActionID) (file string, entry Entry, err error) {
+	entry, err = c.Get(id)
+	if err != nil {
+		return "", Entry{}, err
+	}
+	file = c.OutputFile(entry.OutputID)
+	info, err := os.Stat(file)
+	if err != nil || info.Size() != entry.Size {
+		return "", Entry{}, errMissing
+	}
+	return file, entry, nil
+}
+
 // GetBytes looks up the action ID in the cache and returns
 // the corresponding output bytes.
 // GetBytes should only be used for data that can be expected to fit in memory.
diff --git a/vendor/cmd/go/internal/cfg/cfg.go b/vendor/cmd/go/internal/cfg/cfg.go
index 03a4746..98afaa2 100644
--- a/vendor/cmd/go/internal/cfg/cfg.go
+++ b/vendor/cmd/go/internal/cfg/cfg.go
@@ -85,7 +85,7 @@
 	GOROOT_FINAL = findGOROOT_FINAL()
 
 	// Used in envcmd.MkEnv and build ID computations.
-	GOARM, GO386, GOMIPS = objabi()
+	GOARM, GO386, GOMIPS, GOMIPS64 = objabi()
 
 	// C and C++ compilers
 	CC, CXX = compilers()
@@ -94,14 +94,17 @@
 // Update build context to use our computed GOROOT.
 func init() {
 	BuildContext.GOROOT = GOROOT
-	// Note that we must use runtime.GOOS and runtime.GOARCH here,
-	// as the tool directory does not move based on environment variables.
-	// This matches the initialization of ToolDir in go/build,
-	// except for using GOROOT rather than runtime.GOROOT().
-	build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
+	if runtime.Compiler != "gccgo" {
+		// Note that we must use runtime.GOOS and runtime.GOARCH here,
+		// as the tool directory does not move based on environment
+		// variables. This matches the initialization of ToolDir in
+		// go/build, except for using GOROOT rather than
+		// runtime.GOROOT.
+		build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
+	}
 }
 
-func objabi() (GOARM, GO386, GOMIPS string) {
+func objabi() (GOARM, GO386, GOMIPS, GOMIPS64 string) {
 	data, err := ioutil.ReadFile(filepath.Join(GOROOT, "src/cmd/internal/objabi/zbootstrap.go"))
 	if err != nil {
 		fmt.Fprintf(os.Stderr, "vgo objabi: %v\n", err)
@@ -113,6 +116,9 @@
 		}
 		i := bytes.Index(data, []byte("default"+key+" = `"))
 		if i < 0 {
+			if key == "GOMIPS64" { // new in Go 1.11
+				return ""
+			}
 			fmt.Fprintf(os.Stderr, "vgo objabi: cannot find %s\n", key)
 			os.Exit(2)
 		}
@@ -121,7 +127,7 @@
 		return string(line[:bytes.IndexByte(line, '`')])
 	}
 
-	return find("GOARM"), find("GO386"), find("GOMIPS")
+	return find("GOARM"), find("GO386"), find("GOMIPS"), find("GOMIPS64")
 }
 
 func compilers() (CC, CXX string) {
diff --git a/vendor/cmd/go/internal/cfg/zosarch.go b/vendor/cmd/go/internal/cfg/zosarch.go
index b7cfc7b..8ba3699 100644
--- a/vendor/cmd/go/internal/cfg/zosarch.go
+++ b/vendor/cmd/go/internal/cfg/zosarch.go
@@ -3,42 +3,43 @@
 package cfg
 
 var OSArchSupportsCgo = map[string]bool{
-	"android/386": true,
-	"android/amd64": true,
-	"android/arm": true,
-	"android/arm64": true,
-	"darwin/386": true,
-	"darwin/amd64": true,
-	"darwin/arm": true,
-	"darwin/arm64": true,
+	"android/386":     true,
+	"android/amd64":   true,
+	"android/arm":     true,
+	"android/arm64":   true,
+	"darwin/386":      true,
+	"darwin/amd64":    true,
+	"darwin/arm":      true,
+	"darwin/arm64":    true,
 	"dragonfly/amd64": true,
-	"freebsd/386": true,
-	"freebsd/amd64": true,
-	"freebsd/arm": false,
-	"linux/386": true,
-	"linux/amd64": true,
-	"linux/arm": true,
-	"linux/arm64": true,
-	"linux/mips": true,
-	"linux/mips64": true,
-	"linux/mips64le": true,
-	"linux/mipsle": true,
-	"linux/ppc64": false,
-	"linux/ppc64le": true,
-	"linux/s390x": true,
-	"nacl/386": false,
-	"nacl/amd64p32": false,
-	"nacl/arm": false,
-	"netbsd/386": true,
-	"netbsd/amd64": true,
-	"netbsd/arm": true,
-	"openbsd/386": true,
-	"openbsd/amd64": true,
-	"openbsd/arm": false,
-	"plan9/386": false,
-	"plan9/amd64": false,
-	"plan9/arm": false,
-	"solaris/amd64": true,
-	"windows/386": true,
-	"windows/amd64": true,
+	"freebsd/386":     true,
+	"freebsd/amd64":   true,
+	"freebsd/arm":     false,
+	"js/wasm":         false,
+	"linux/386":       true,
+	"linux/amd64":     true,
+	"linux/arm":       true,
+	"linux/arm64":     true,
+	"linux/mips":      true,
+	"linux/mips64":    true,
+	"linux/mips64le":  true,
+	"linux/mipsle":    true,
+	"linux/ppc64":     false,
+	"linux/ppc64le":   true,
+	"linux/s390x":     true,
+	"nacl/386":        false,
+	"nacl/amd64p32":   false,
+	"nacl/arm":        false,
+	"netbsd/386":      true,
+	"netbsd/amd64":    true,
+	"netbsd/arm":      true,
+	"openbsd/386":     true,
+	"openbsd/amd64":   true,
+	"openbsd/arm":     false,
+	"plan9/386":       false,
+	"plan9/amd64":     false,
+	"plan9/arm":       false,
+	"solaris/amd64":   true,
+	"windows/386":     true,
+	"windows/amd64":   true,
 }
diff --git a/vendor/cmd/go/internal/envcmd/env.go b/vendor/cmd/go/internal/envcmd/env.go
index 11dca7c..bd66a98 100644
--- a/vendor/cmd/go/internal/envcmd/env.go
+++ b/vendor/cmd/go/internal/envcmd/env.go
@@ -80,6 +80,8 @@
 		env = append(env, cfg.EnvVar{Name: "GO386", Value: cfg.GO386})
 	case "mips", "mipsle":
 		env = append(env, cfg.EnvVar{Name: "GOMIPS", Value: cfg.GOMIPS})
+	case "mips64", "mips64le":
+		env = append(env, cfg.EnvVar{Name: "GOMIPS64", Value: cfg.GOMIPS64})
 	}
 
 	cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch)
diff --git a/vendor/cmd/go/internal/generate/generate.go b/vendor/cmd/go/internal/generate/generate.go
index e839f0b..d5d339b 100644
--- a/vendor/cmd/go/internal/generate/generate.go
+++ b/vendor/cmd/go/internal/generate/generate.go
@@ -162,8 +162,19 @@
 			}
 			continue
 		}
+
+		pkgName := pkg.Name
+
 		for _, file := range pkg.InternalGoFiles() {
-			if !generate(pkg.Name, file) {
+			if !generate(pkgName, file) {
+				break
+			}
+		}
+
+		pkgName += "_test"
+
+		for _, file := range pkg.InternalXGoFiles() {
+			if !generate(pkgName, file) {
 				break
 			}
 		}
diff --git a/vendor/cmd/go/internal/get/discovery.go b/vendor/cmd/go/internal/get/discovery.go
index b2918db..97aa1d7 100644
--- a/vendor/cmd/go/internal/get/discovery.go
+++ b/vendor/cmd/go/internal/get/discovery.go
@@ -55,6 +55,13 @@
 			continue
 		}
 		if f := strings.Fields(attrValue(e.Attr, "content")); len(f) == 3 {
+			// Ignore VCS type "mod", which is new Go modules.
+			// This code is for old go get and must ignore the new mod lines.
+			// Otherwise matchGoImport will complain about two
+			// different metaImport lines for the same Prefix.
+			if f[1] == "mod" {
+				continue
+			}
 			imports = append(imports, metaImport{
 				Prefix:   f[0],
 				VCS:      f[1],
diff --git a/vendor/cmd/go/internal/get/get.go b/vendor/cmd/go/internal/get/get.go
index 6e9b498..6eabc4e 100644
--- a/vendor/cmd/go/internal/get/get.go
+++ b/vendor/cmd/go/internal/get/get.go
@@ -215,7 +215,7 @@
 // download runs the download half of the get command
 // for the package named by the argument.
 func download(arg string, parent *load.Package, stk *load.ImportStack, mode int) {
-	if mode&load.UseVendor != 0 {
+	if mode&load.ResolveImport != 0 {
 		// Caller is responsible for expanding vendor paths.
 		panic("internal error: download mode has useVendor set")
 	}
@@ -223,7 +223,7 @@
 		if parent == nil {
 			return load.LoadPackage(path, stk)
 		}
-		return load.LoadImport(path, parent.Dir, parent, stk, nil, mode)
+		return load.LoadImport(path, parent.Dir, parent, stk, nil, mode|load.ResolveModule)
 	}
 
 	p := load1(arg, mode)
@@ -352,12 +352,12 @@
 				base.Errorf("%s", err)
 				continue
 			}
-			// If this is a test import, apply vendor lookup now.
-			// We cannot pass useVendor to download, because
+			// If this is a test import, apply module and vendor lookup now.
+			// We cannot pass ResolveImport to download, because
 			// download does caching based on the value of path,
 			// so it must be the fully qualified path already.
 			if i >= len(p.Imports) {
-				path = load.VendoredImportPath(p, path)
+				path = load.ResolveImportPath(p, path)
 			}
 			download(path, p, stk, 0)
 		}
@@ -375,6 +375,7 @@
 		vcs            *vcsCmd
 		repo, rootPath string
 		err            error
+		blindRepo      bool // set if the repo has unusual configuration
 	)
 
 	security := web.Secure
@@ -395,10 +396,12 @@
 			dir := filepath.Join(p.Internal.Build.SrcRoot, filepath.FromSlash(rootPath))
 			remote, err := vcs.remoteRepo(vcs, dir)
 			if err != nil {
-				return err
+				// Proceed anyway. The package is present; we likely just don't understand
+				// the repo configuration (e.g. unusual remote protocol).
+				blindRepo = true
 			}
 			repo = remote
-			if !*getF {
+			if !*getF && err == nil {
 				if rr, err := repoRootForImportPath(p.ImportPath, security); err == nil {
 					repo := rr.repo
 					if rr.vcs.resolveRepo != nil {
@@ -422,7 +425,7 @@
 		}
 		vcs, repo, rootPath = rr.vcs, rr.repo, rr.root
 	}
-	if !vcs.isSecure(repo) && !*getInsecure {
+	if !blindRepo && !vcs.isSecure(repo) && !*getInsecure {
 		return fmt.Errorf("cannot download, %v uses insecure protocol", repo)
 	}
 
diff --git a/vendor/cmd/go/internal/get/pkg_test.go b/vendor/cmd/go/internal/get/pkg_test.go
index b8937a5..1179d86 100644
--- a/vendor/cmd/go/internal/get/pkg_test.go
+++ b/vendor/cmd/go/internal/get/pkg_test.go
@@ -48,6 +48,20 @@
 		},
 	},
 	{
+		`<meta name="go-import" content="foo/bar git https://github.com/rsc/foo/bar">
+		<meta name="go-import" content="foo/bar mod http://github.com/rsc/baz/quux">`,
+		[]metaImport{
+			{"foo/bar", "git", "https://github.com/rsc/foo/bar"},
+		},
+	},
+	{
+		`<meta name="go-import" content="foo/bar mod http://github.com/rsc/baz/quux">
+		<meta name="go-import" content="foo/bar git https://github.com/rsc/foo/bar">`,
+		[]metaImport{
+			{"foo/bar", "git", "https://github.com/rsc/foo/bar"},
+		},
+	},
+	{
 		`<head>
 		<meta name="go-import" content="foo/bar git https://github.com/rsc/foo/bar">
 		</head>`,
diff --git a/vendor/cmd/go/internal/get/vcs.go b/vendor/cmd/go/internal/get/vcs.go
index ee6b16a..45fc69a 100644
--- a/vendor/cmd/go/internal/get/vcs.go
+++ b/vendor/cmd/go/internal/get/vcs.go
@@ -809,8 +809,8 @@
 		}
 	}
 
-	if !strings.Contains(mmi.RepoRoot, "://") {
-		return nil, fmt.Errorf("%s: invalid repo root %q; no scheme", urlStr, mmi.RepoRoot)
+	if err := validateRepoRoot(mmi.RepoRoot); err != nil {
+		return nil, fmt.Errorf("%s: invalid repo root %q: %v", urlStr, mmi.RepoRoot, err)
 	}
 	rr := &repoRoot{
 		vcs:      vcsByCmd(mmi.VCS),
@@ -824,6 +824,19 @@
 	return rr, nil
 }
 
+// validateRepoRoot returns an error if repoRoot does not seem to be
+// a valid URL with scheme.
+func validateRepoRoot(repoRoot string) error {
+	url, err := url.Parse(repoRoot)
+	if err != nil {
+		return err
+	}
+	if url.Scheme == "" {
+		return errors.New("no scheme")
+	}
+	return nil
+}
+
 var fetchGroup singleflight.Group
 var (
 	fetchCacheMu sync.Mutex
diff --git a/vendor/cmd/go/internal/get/vcs_test.go b/vendor/cmd/go/internal/get/vcs_test.go
index 2cb611f..1ce9b73 100644
--- a/vendor/cmd/go/internal/get/vcs_test.go
+++ b/vendor/cmd/go/internal/get/vcs_test.go
@@ -416,3 +416,47 @@
 		}
 	}
 }
+
+func TestValidateRepoRoot(t *testing.T) {
+	tests := []struct {
+		root string
+		ok   bool
+	}{
+		{
+			root: "",
+			ok:   false,
+		},
+		{
+			root: "http://",
+			ok:   true,
+		},
+		{
+			root: "git+ssh://",
+			ok:   true,
+		},
+		{
+			root: "http#://",
+			ok:   false,
+		},
+		{
+			root: "-config",
+			ok:   false,
+		},
+		{
+			root: "-config://",
+			ok:   false,
+		},
+	}
+
+	for _, test := range tests {
+		err := validateRepoRoot(test.root)
+		ok := err == nil
+		if ok != test.ok {
+			want := "error"
+			if test.ok {
+				want = "nil"
+			}
+			t.Errorf("validateRepoRoot(%q) = %q, want %s", test.root, err, want)
+		}
+	}
+}
diff --git a/vendor/cmd/go/internal/help/helpdoc.go b/vendor/cmd/go/internal/help/helpdoc.go
index c39af79..a90d19e 100644
--- a/vendor/cmd/go/internal/help/helpdoc.go
+++ b/vendor/cmd/go/internal/help/helpdoc.go
@@ -461,6 +461,9 @@
 		Examples are amd64, 386, arm, ppc64.
 	GOBIN
 		The directory where 'go install' will install a command.
+	GOCACHE
+		The directory where the go command will store cached
+		information for reuse in future builds.
 	GOOS
 		The operating system for which to compile code.
 		Examples are linux, darwin, windows, netbsd.
@@ -474,9 +477,10 @@
 	GOTMPDIR
 		The directory where the go command will write
 		temporary source files, packages, and binaries.
-	GOCACHE
-		The directory where the go command will store
-		cached information for reuse in future builds.
+	GOTOOLDIR
+		The directory where the go tools (compile, cover, doc, etc...)
+		are installed. This is printed by go env, but setting the
+		environment variable has no effect.
 
 Environment variables for use with cgo:
 
@@ -523,9 +527,15 @@
 	GOMIPS
 		For GOARCH=mips{,le}, whether to use floating point instructions.
 		Valid values are hardfloat (default), softfloat.
+	GOMIPS64
+		For GOARCH=mips64{,le}, whether to use floating point instructions.
+		Valid values are hardfloat (default), softfloat.
 
 Special-purpose environment variables:
 
+	GCCGOTOOLDIR
+		If set, where to find gccgo tools, such as cgo.
+		The default is based on how gccgo was configured.
 	GOROOT_FINAL
 		The root of the installed Go tree, when it is
 		installed in a location other than where it is built.
diff --git a/vendor/cmd/go/internal/list/list.go b/vendor/cmd/go/internal/list/list.go
index bf52614..19388d4 100644
--- a/vendor/cmd/go/internal/list/list.go
+++ b/vendor/cmd/go/internal/list/list.go
@@ -7,13 +7,16 @@
 
 import (
 	"bufio"
+	"bytes"
 	"encoding/json"
 	"io"
 	"os"
+	"sort"
 	"strings"
 	"text/template"
 
 	"cmd/go/internal/base"
+	"cmd/go/internal/cache"
 	"cmd/go/internal/cfg"
 	"cmd/go/internal/load"
 	"cmd/go/internal/vgo"
@@ -21,7 +24,7 @@
 )
 
 var CmdList = &base.Command{
-	UsageLine: "list [-e] [-f format] [-json] [build flags] [packages]",
+	UsageLine: "list [-cgo] [-deps] [-e] [-export] [-f format] [-json] [-test] [build flags] [packages]",
 	Short:     "list packages",
 	Long: `
 List lists the packages named by the import paths, one per line.
@@ -52,6 +55,9 @@
         Root          string // Go root or Go path dir containing this package
         ConflictDir   string // this directory shadows Dir in $GOPATH
         BinaryOnly    bool   // binary-only package: cannot be recompiled from sources
+        ForTest       string // package is only for use in named test
+        DepOnly       bool   // package is only a dependency, not explicitly listed
+        Export        string // file containing export data (when using -export)
 
         // Source files
         GoFiles        []string // .go source files (excluding CgoFiles, TestGoFiles, XTestGoFiles)
@@ -126,6 +132,16 @@
 The -json flag causes the package data to be printed in JSON format
 instead of using the template format.
 
+The -cgo flag causes list to set CgoFiles not to the original *.go files
+importing "C" but instead to the translated files generated by the cgo
+command.
+
+The -deps flag causes list to iterate over not just the named packages
+but also all their dependencies. It visits them in a depth-first post-order
+traversal, so that a package is listed only after all its dependencies.
+Packages not explicitly listed on the command line will have the DepOnly
+field set to true.
+
 The -e flag changes the handling of erroneous packages, those that
 cannot be found or are malformed. By default, the list command
 prints an error to standard error for each erroneous package and
@@ -136,6 +152,32 @@
 a non-nil Error field; other information may or may not be missing
 (zeroed).
 
+The -export flag causes list to set the Export field to the name of a
+file containing up-to-date export information for the given package.
+
+The -test flag causes list to report not only the named packages
+but also their test binaries (for packages with tests), to convey to
+source code analysis tools exactly how test binaries are constructed.
+The reported import path for a test binary is the import path of
+the package followed by a ".test" suffix, as in "math/rand.test".
+When building a test, it is sometimes necessary to rebuild certain
+dependencies specially for that test (most commonly the tested
+package itself). The reported import path of a package recompiled
+for a particular test binary is followed by a space and the name of
+the test binary in brackets, as in "math/rand [math/rand.test]"
+or "regexp [sort.test]". The ForTest field is also set to the name
+of the package being tested ("math/rand" or "sort" in the previous
+examples).
+
+The Dir, Target, Shlib, Root, ConflictDir, and Export file paths
+are all absolute paths.
+
+By default, the lists GoFiles, CgoFiles, and so on hold names of files in Dir
+(that is, paths relative to Dir, not absolute paths).
+The extra entries added by the -cgo and -test flags are absolute paths
+referring to cached copies of generated Go source files.
+Although they are Go source files, the paths may not end in ".go".
+
 For more about build flags, see 'go help build'.
 
 For more about specifying packages, see 'go help packages'.
@@ -147,15 +189,19 @@
 	work.AddBuildFlags(CmdList)
 }
 
+var listCgo = CmdList.Flag.Bool("cgo", false, "")
+var listDeps = CmdList.Flag.Bool("deps", false, "")
 var listE = CmdList.Flag.Bool("e", false, "")
+var listExport = CmdList.Flag.Bool("export", false, "")
 var listFmt = CmdList.Flag.String("f", "{{.ImportPath}}", "")
 var listJson = CmdList.Flag.Bool("json", false, "")
+var listTest = CmdList.Flag.Bool("test", false, "")
+var nl = []byte{'\n'}
+
 var listM = CmdList.Flag.Bool("m", false, "")
 var listU = CmdList.Flag.Bool("u", false, "")
 var listT = CmdList.Flag.Bool("t", false, "")
 
-var nl = []byte{'\n'}
-
 func runList(cmd *base.Command, args []string) {
 	work.BuildInit()
 	out := newTrackingWriter(os.Stdout)
@@ -219,13 +265,82 @@
 		pkgs = load.Packages(args)
 	}
 
-	// Estimate whether staleness information is needed,
-	// since it's a little bit of work to compute.
+	if cache.Default() == nil {
+		// These flags return file names pointing into the build cache,
+		// so the build cache must exist.
+		if *listCgo {
+			base.Fatalf("go list -cgo requires build cache")
+		}
+		if *listExport {
+			base.Fatalf("go list -export requires build cache")
+		}
+		if *listTest {
+			base.Fatalf("go list -test requires build cache")
+		}
+	}
+
+	if *listTest {
+		c := cache.Default()
+		// Add test binaries to packages to be listed.
+		for _, p := range pkgs {
+			if p.Error != nil {
+				continue
+			}
+			if len(p.TestGoFiles)+len(p.XTestGoFiles) > 0 {
+				pmain, _, _, err := load.TestPackagesFor(p, nil)
+				if err != nil {
+					if !*listE {
+						base.Errorf("can't load test package: %s", err)
+						continue
+					}
+					pmain = &load.Package{
+						PackagePublic: load.PackagePublic{
+							ImportPath: p.ImportPath + ".test",
+							Error:      &load.PackageError{Err: err.Error()},
+						},
+					}
+				}
+				pkgs = append(pkgs, pmain)
+
+				data := *pmain.Internal.TestmainGo
+				h := cache.NewHash("testmain")
+				h.Write([]byte("testmain\n"))
+				h.Write(data)
+				out, _, err := c.Put(h.Sum(), bytes.NewReader(data))
+				if err != nil {
+					base.Fatalf("%s", err)
+				}
+				pmain.GoFiles[0] = c.OutputFile(out)
+			}
+		}
+	}
+
+	// Remember which packages are named on the command line.
+	cmdline := make(map[*load.Package]bool)
+	for _, p := range pkgs {
+		cmdline[p] = true
+	}
+
+	if *listDeps {
+		// Note: This changes the order of the listed packages
+		// from "as written on the command line" to
+		// "a depth-first post-order traversal".
+		// (The dependency exploration order for a given node
+		// is alphabetical, same as listed in .Deps.)
+		// Note that -deps is applied after -test,
+		// so that you only get descriptions of tests for the things named
+		// explicitly on the command line, not for all dependencies.
+		pkgs = load.PackageList(pkgs)
+	}
+
+	// Do we need to run a build to gather information?
 	needStale := *listJson || strings.Contains(*listFmt, ".Stale")
-	if needStale {
+	if needStale || *listExport || *listCgo {
 		var b work.Builder
 		b.Init()
-		b.ComputeStaleOnly = true
+		b.IsCmdList = true
+		b.NeedExport = *listExport
+		b.NeedCgoFiles = *listCgo
 		a := &work.Action{}
 		// TODO: Use pkgsFilter?
 		for _, p := range pkgs {
@@ -234,12 +349,60 @@
 		b.Do(a)
 	}
 
-	for _, pkg := range pkgs {
+	for _, p := range pkgs {
 		// Show vendor-expanded paths in listing
-		pkg.TestImports = pkg.Vendored(pkg.TestImports)
-		pkg.XTestImports = pkg.Vendored(pkg.XTestImports)
+		p.TestImports = p.Resolve(p.TestImports)
+		p.XTestImports = p.Resolve(p.XTestImports)
+		p.DepOnly = !cmdline[p]
+	}
 
-		do(&pkg.PackagePublic)
+	if *listTest {
+		all := pkgs
+		if !*listDeps {
+			all = load.PackageList(pkgs)
+		}
+		// Update import paths to distinguish the real package p
+		// from p recompiled for q.test.
+		// This must happen only once the build code is done
+		// looking at import paths, because it will get very confused
+		// if it sees these.
+		for _, p := range all {
+			if p.ForTest != "" {
+				p.ImportPath += " [" + p.ForTest + ".test]"
+			}
+			p.DepOnly = !cmdline[p]
+		}
+		// Update import path lists to use new strings.
+		for _, p := range all {
+			j := 0
+			for i := range p.Imports {
+				// Internal skips "C"
+				if p.Imports[i] == "C" {
+					continue
+				}
+				p.Imports[i] = p.Internal.Imports[j].ImportPath
+				j++
+			}
+		}
+		// Recompute deps lists using new strings, from the leaves up.
+		for _, p := range all {
+			deps := make(map[string]bool)
+			for _, p1 := range p.Internal.Imports {
+				deps[p1.ImportPath] = true
+				for _, d := range p1.Deps {
+					deps[d] = true
+				}
+			}
+			p.Deps = make([]string, 0, len(deps))
+			for d := range deps {
+				p.Deps = append(p.Deps, d)
+			}
+			sort.Strings(p.Deps)
+		}
+	}
+
+	for _, p := range pkgs {
+		do(&p.PackagePublic)
 	}
 }
 
diff --git a/vendor/cmd/go/internal/load/path.go b/vendor/cmd/go/internal/load/path.go
index 8f3184e..0211b28 100644
--- a/vendor/cmd/go/internal/load/path.go
+++ b/vendor/cmd/go/internal/load/path.go
@@ -32,8 +32,6 @@
 	return filepath.ToSlash(dir[len(root):]), true
 }
 
-// vgo: hasPathPrefix moved to ../search
-
 // expandPath returns the symlink-expanded form of path.
 func expandPath(p string) string {
 	x, err := filepath.EvalSymlinks(p)
diff --git a/vendor/cmd/go/internal/load/pkg.go b/vendor/cmd/go/internal/load/pkg.go
index 16228ae..400b338 100644
--- a/vendor/cmd/go/internal/load/pkg.go
+++ b/vendor/cmd/go/internal/load/pkg.go
@@ -6,6 +6,7 @@
 package load
 
 import (
+	"bytes"
 	"fmt"
 	"go/build"
 	"go/token"
@@ -14,6 +15,7 @@
 	pathpkg "path"
 	"path/filepath"
 	"sort"
+	"strconv"
 	"strings"
 	"unicode"
 	"unicode/utf8"
@@ -50,6 +52,9 @@
 	Root          string `json:",omitempty"` // Go root or Go path dir containing this package
 	ConflictDir   string `json:",omitempty"` // Dir is hidden by this other directory
 	BinaryOnly    bool   `json:",omitempty"` // package cannot be recompiled
+	ForTest       string `json:",omitempty"` // package is only for use in named test
+	DepOnly       bool   `json:",omitempty"` // package is only as a dependency, not explicitly listed
+	Export        string `json:",omitempty"` // file containing export data (set by go list -export)
 
 	// Stale and StaleReason remain here *only* for the list command.
 	// They are only initialized in preparation for list execution.
@@ -98,7 +103,7 @@
 	XTestGoFiles []string `json:",omitempty"` // _test.go files outside package
 	XTestImports []string `json:",omitempty"` // imports from XTestGoFiles
 
-	Module modinfo.ModulePublic
+	Module *modinfo.ModulePublic `json:",omitempty"` // info about package module
 }
 
 // AllFiles returns the names of all the files considered for the package.
@@ -125,6 +130,14 @@
 	)
 }
 
+// Desc returns the package "description", for use in b.showOutput.
+func (p *Package) Desc() string {
+	if p.ForTest != "" {
+		return p.ImportPath + " [" + p.ForTest + ".test]"
+	}
+	return p.ImportPath
+}
+
 type PackageInternal struct {
 	// Unexported fields are not part of the public API.
 	Build        *build.Package
@@ -140,8 +153,8 @@
 	CoverVars    map[string]*CoverVar // variables created by coverage analysis
 	OmitDebug    bool                 // tell linker not to write debug information
 	GobinSubdir  bool                 // install target would be subdir of GOBIN
-
-	BuildInfo string // add this info to package main
+	BuildInfo    string               // add this info to package main
+	TestmainGo   *[]byte              // content for _testmain.go
 
 	Asmflags   []string // -asmflags for this package
 	Gcflags    []string // -gcflags for this package
@@ -175,7 +188,7 @@
 	return "no Go files in " + e.Package.Dir
 }
 
-// Vendored returns the vendor-resolved version of imports,
+// Resolve returns the resolved version of imports,
 // which should be p.TestImports or p.XTestImports, NOT p.Imports.
 // The imports in p.TestImports and p.XTestImports are not recursively
 // loaded during the initial load of p, so they list the imports found in
@@ -185,14 +198,14 @@
 // can produce better error messages if it starts with the original paths.
 // The initial load of p loads all the non-test imports and rewrites
 // the vendored paths, so nothing should ever call p.vendored(p.Imports).
-func (p *Package) Vendored(imports []string) []string {
+func (p *Package) Resolve(imports []string) []string {
 	if len(imports) > 0 && len(p.Imports) > 0 && &imports[0] == &p.Imports[0] {
-		panic("internal error: p.vendored(p.Imports) called")
+		panic("internal error: p.Resolve(p.Imports) called")
 	}
 	seen := make(map[string]bool)
 	var all []string
 	for _, path := range imports {
-		path = VendoredImportPath(p, path)
+		path = ResolveImportPath(p, path)
 		if !seen[path] {
 			seen[path] = true
 			all = append(all, path)
@@ -374,16 +387,20 @@
 
 // Mode flags for loadImport and download (in get.go).
 const (
-	// UseVendor means that loadImport should do vendor expansion
-	// (provided the vendoring experiment is enabled).
-	// That is, useVendor means that the import path came from
-	// a source file and has not been vendor-expanded yet.
-	// Every import path should be loaded initially with useVendor,
-	// and then the expanded version (with the /vendor/ in it) gets
-	// recorded as the canonical import path. At that point, future loads
-	// of that package must not pass useVendor, because
+	// ResolveImport means that loadImport should do import path expansion.
+	// That is, ResolveImport means that the import path came from
+	// a source file and has not been expanded yet to account for
+	// vendoring or possible module adjustment.
+	// Every import path should be loaded initially with ResolveImport,
+	// and then the expanded version (for example with the /vendor/ in it)
+	// gets recorded as the canonical import path. At that point, future loads
+	// of that package must not pass ResolveImport, because
 	// disallowVendor will reject direct use of paths containing /vendor/.
-	UseVendor = 1 << iota
+	ResolveImport = 1 << iota
+
+	// ResolveModule is for download (part of "go get") and indicates
+	// that the module adjustment should be done, but not vendor adjustment.
+	ResolveModule
 
 	// GetTestDeps is for download (part of "go get") and indicates
 	// that test dependencies should be fetched too.
@@ -420,12 +437,15 @@
 		if vgoErr == nil {
 			importPath = p
 		}
-	} else if mode&UseVendor != 0 {
-		// We do our own vendor resolution, because we want to
+	} else if mode&ResolveImport != 0 {
+		// We do our own path resolution, because we want to
 		// find out the key to use in packageCache without the
 		// overhead of repeated calls to buildContext.Import.
 		// The code is also needed in a few other places anyway.
-		path = VendoredImportPath(parent, path)
+		path = ResolveImportPath(parent, path)
+		importPath = path
+	} else if mode&ResolveModule != 0 {
+		path = ModuleImportPath(parent, path)
 		importPath = path
 	}
 
@@ -450,7 +470,7 @@
 			err = fmt.Errorf("unknown import path %q: %v", importPath, vgoErr)
 		} else {
 			buildMode := build.ImportComment
-			if mode&UseVendor == 0 || path != origPath {
+			if mode&ResolveImport == 0 || path != origPath {
 				// Not vendoring, or we already found the vendored path.
 				buildMode |= build.IgnoreVendor
 			}
@@ -484,7 +504,7 @@
 	if perr := disallowInternal(srcDir, p, stk); perr != p {
 		return setErrorPos(perr, importPos)
 	}
-	if mode&UseVendor != 0 {
+	if mode&ResolveImport != 0 {
 		if perr := disallowVendor(srcDir, origPath, p, stk); perr != p {
 			return setErrorPos(perr, importPos)
 		}
@@ -543,11 +563,12 @@
 	return result
 }
 
-// VendoredImportPath returns the expansion of path when it appears in parent.
-// If parent is x/y/z, then path might expand to x/y/z/vendor/path, x/y/vendor/path,
-// x/vendor/path, vendor/path, or else stay path if none of those exist.
-// VendoredImportPath returns the expanded path or, if no expansion is found, the original.
-func VendoredImportPath(parent *Package, path string) (found string) {
+// ResolveImportPath returns the true meaning of path when it appears in parent.
+// There are two different resolutions applied.
+// First, there is Go 1.5 vendoring (golang.org/s/go15vendor).
+// If vendor expansion doesn't trigger, then the path is also subject to
+// Go 1.11 vgo legacy conversion (golang.org/issue/25069).
+func ResolveImportPath(parent *Package, path string) (found string) {
 	if vgo.Enabled() {
 		parentPath := ""
 		if parent != nil {
@@ -558,20 +579,25 @@
 		}
 		return path
 	}
-
-	if parent == nil || parent.Root == "" {
-		return path
+	found = VendoredImportPath(parent, path)
+	if found != path {
+		return found
 	}
+	return ModuleImportPath(parent, path)
+}
 
-	dir := filepath.Clean(parent.Dir)
-	root := filepath.Join(parent.Root, "src")
-	if !str.HasFilePathPrefix(dir, root) || parent.ImportPath != "command-line-arguments" && filepath.Join(root, parent.ImportPath) != dir {
+// dirAndRoot returns the source directory and workspace root
+// for the package p, guaranteeing that root is a path prefix of dir.
+func dirAndRoot(p *Package) (dir, root string) {
+	dir = filepath.Clean(p.Dir)
+	root = filepath.Join(p.Root, "src")
+	if !str.HasFilePathPrefix(dir, root) || p.ImportPath != "command-line-arguments" && filepath.Join(root, p.ImportPath) != dir {
 		// Look for symlinks before reporting error.
 		dir = expandPath(dir)
 		root = expandPath(root)
 	}
 
-	if !str.HasFilePathPrefix(dir, root) || len(dir) <= len(root) || dir[len(root)] != filepath.Separator || parent.ImportPath != "command-line-arguments" && !parent.Internal.Local && filepath.Join(root, parent.ImportPath) != dir {
+	if !str.HasFilePathPrefix(dir, root) || len(dir) <= len(root) || dir[len(root)] != filepath.Separator || p.ImportPath != "command-line-arguments" && !p.Internal.Local && filepath.Join(root, p.ImportPath) != dir {
 		base.Fatalf("unexpected directory layout:\n"+
 			"	import path: %s\n"+
 			"	root: %s\n"+
@@ -579,14 +605,28 @@
 			"	expand root: %s\n"+
 			"	expand dir: %s\n"+
 			"	separator: %s",
-			parent.ImportPath,
-			filepath.Join(parent.Root, "src"),
-			filepath.Clean(parent.Dir),
+			p.ImportPath,
+			filepath.Join(p.Root, "src"),
+			filepath.Clean(p.Dir),
 			root,
 			dir,
 			string(filepath.Separator))
 	}
 
+	return dir, root
+}
+
+// VendoredImportPath returns the vendor-expansion of path when it appears in parent.
+// If parent is x/y/z, then path might expand to x/y/z/vendor/path, x/y/vendor/path,
+// x/vendor/path, vendor/path, or else stay path if none of those exist.
+// VendoredImportPath returns the expanded path or, if no expansion is found, the original.
+func VendoredImportPath(parent *Package, path string) (found string) {
+	if parent == nil || parent.Root == "" {
+		return path
+	}
+
+	dir, root := dirAndRoot(parent)
+
 	vpath := "vendor/" + path
 	for i := len(dir); i >= len(root); i-- {
 		if i < len(dir) && dir[i] != filepath.Separator {
@@ -629,6 +669,164 @@
 	return path
 }
 
+var (
+	modulePrefix   = []byte("\nmodule ")
+	goModPathCache = make(map[string]string)
+)
+
+// goModPath returns the module path in the go.mod in dir, if any.
+func goModPath(dir string) (path string) {
+	path, ok := goModPathCache[dir]
+	if ok {
+		return path
+	}
+	defer func() {
+		goModPathCache[dir] = path
+	}()
+
+	data, err := ioutil.ReadFile(filepath.Join(dir, "go.mod"))
+	if err != nil {
+		return ""
+	}
+	var i int
+	if bytes.HasPrefix(data, modulePrefix[1:]) {
+		i = 0
+	} else {
+		i = bytes.Index(data, modulePrefix)
+		if i < 0 {
+			return ""
+		}
+		i++
+	}
+	line := data[i:]
+
+	// Cut line at \n, drop trailing \r if present.
+	if j := bytes.IndexByte(line, '\n'); j >= 0 {
+		line = line[:j]
+	}
+	if line[len(line)-1] == '\r' {
+		line = line[:len(line)-1]
+	}
+	line = line[len("module "):]
+
+	// If quoted, unquote.
+	path = strings.TrimSpace(string(line))
+	if path != "" && path[0] == '"' {
+		s, err := strconv.Unquote(path)
+		if err != nil {
+			return ""
+		}
+		path = s
+	}
+	return path
+}
+
+// findVersionElement returns the slice indices of the final version element /vN in path.
+// If there is no such element, it returns -1, -1.
+func findVersionElement(path string) (i, j int) {
+	j = len(path)
+	for i = len(path) - 1; i >= 0; i-- {
+		if path[i] == '/' {
+			if isVersionElement(path[i:j]) {
+				return i, j
+			}
+			j = i
+		}
+	}
+	return -1, -1
+}
+
+// isVersionElement reports whether s is a well-formed path version element:
+// v2, v3, v10, etc, but not v0, v05, v1.
+func isVersionElement(s string) bool {
+	if len(s) < 3 || s[0] != '/' || s[1] != 'v' || s[2] == '0' || s[2] == '1' && len(s) == 3 {
+		return false
+	}
+	for i := 2; i < len(s); i++ {
+		if s[i] < '0' || '9' < s[i] {
+			return false
+		}
+	}
+	return true
+}
+
+// ModuleImportPath translates import paths found in go modules
+// back down to paths that can be resolved in ordinary builds.
+//
+// Define “new” code as code with a go.mod file in the same directory
+// or a parent directory. If an import in new code says x/y/v2/z but
+// x/y/v2/z does not exist and x/y/go.mod says “module x/y/v2”,
+// then go build will read the import as x/y/z instead.
+// See golang.org/issue/25069.
+func ModuleImportPath(parent *Package, path string) (found string) {
+	if parent == nil || parent.Root == "" {
+		return path
+	}
+
+	// If there are no vN elements in path, leave it alone.
+	// (The code below would do the same, but only after
+	// some other file system accesses that we can avoid
+	// here by returning early.)
+	if i, _ := findVersionElement(path); i < 0 {
+		return path
+	}
+
+	dir, root := dirAndRoot(parent)
+
+	// Consider dir and parents, up to and including root.
+	for i := len(dir); i >= len(root); i-- {
+		if i < len(dir) && dir[i] != filepath.Separator {
+			continue
+		}
+		if goModPath(dir[:i]) != "" {
+			goto HaveGoMod
+		}
+	}
+	// This code is not in a tree with a go.mod,
+	// so apply no changes to the path.
+	return path
+
+HaveGoMod:
+	// This import is in a tree with a go.mod.
+	// Allow it to refer to code in GOPATH/src/x/y/z as x/y/v2/z
+	// if GOPATH/src/x/y/go.mod says module "x/y/v2",
+
+	// If x/y/v2/z exists, use it unmodified.
+	if bp, _ := cfg.BuildContext.Import(path, "", build.IgnoreVendor); bp.Dir != "" {
+		return path
+	}
+
+	// Otherwise look for a go.mod supplying a version element.
+	// Some version-like elements may appear in paths but not
+	// be module versions; we skip over those to look for module
+	// versions. For example the module m/v2 might have a
+	// package m/v2/api/v1/foo.
+	limit := len(path)
+	for limit > 0 {
+		i, j := findVersionElement(path[:limit])
+		if i < 0 {
+			return path
+		}
+		if bp, _ := cfg.BuildContext.Import(path[:i], "", build.IgnoreVendor); bp.Dir != "" {
+			if mpath := goModPath(bp.Dir); mpath != "" {
+				// Found a valid go.mod file, so we're stopping the search.
+				// If the path is m/v2/p and we found m/go.mod that says
+				// "module m/v2", then we return "m/p".
+				if mpath == path[:j] {
+					return path[:i] + path[j:]
+				}
+				// Otherwise just return the original path.
+				// We didn't find anything worth rewriting,
+				// and the go.mod indicates that we should
+				// not consider parent directories.
+				return path
+			}
+		}
+		limit = i
+	}
+	return path
+}
+
 // hasGoFiles reports whether dir contains any files with names ending in .go.
 // For a vendor check we must exclude directories that contain no .go files.
 // Otherwise it is not possible to vendor just a/b/c and still import the
@@ -973,7 +1171,11 @@
 		if InstallTargetDir(p) == ToTool {
 			// This is for 'go tool'.
 			// Override all the usual logic and force it into the tool directory.
-			p.Target = filepath.Join(cfg.GOROOTpkg, "tool", full)
+			if cfg.BuildToolchainName == "gccgo" {
+				p.Target = filepath.Join(base.ToolDir, elem)
+			} else {
+				p.Target = filepath.Join(cfg.GOROOTpkg, "tool", full)
+			}
 		}
 		if p.Target != "" && cfg.BuildContext.GOOS == "windows" {
 			p.Target += ".exe"
@@ -1015,7 +1217,7 @@
 
 	// Cgo translation adds imports of "runtime/cgo" and "syscall",
 	// except for certain packages, to avoid circular dependencies.
-	if p.UsesCgo() && (!p.Standard || !cgoExclude[p.ImportPath]) {
+	if p.UsesCgo() && (!p.Standard || !cgoExclude[p.ImportPath]) && cfg.BuildContext.Compiler != "gccgo" {
 		addImport("runtime/cgo")
 	}
 	if p.UsesCgo() && (!p.Standard || !cgoSyscallExclude[p.ImportPath]) {
@@ -1024,7 +1226,9 @@
 
 	// SWIG adds imports of some standard packages.
 	if p.UsesSwig() {
-		addImport("runtime/cgo")
+		if cfg.BuildContext.Compiler != "gccgo" {
+			addImport("runtime/cgo")
+		}
 		addImport("syscall")
 		addImport("sync")
 
@@ -1090,7 +1294,7 @@
 		if path == "C" {
 			continue
 		}
-		p1 := LoadImport(path, p.Dir, p, stk, p.Internal.Build.ImportPos[path], UseVendor)
+		p1 := LoadImport(path, p.Dir, p, stk, p.Internal.Build.ImportPos[path], ResolveImport)
 		if p.Standard && p.Error == nil && !p1.Standard && p1.Error == nil {
 			p.Error = &PackageError{
 				ImportStack: stk.Copy(),
@@ -1206,9 +1410,11 @@
 		return
 	}
 
-	p.Module = vgo.PackageModuleInfo(p.ImportPath)
-	if p.Name == "main" {
-		p.Internal.BuildInfo = vgo.PackageBuildInfo(p.ImportPath, p.Deps)
+	if vgo.Enabled() {
+		p.Module = vgo.PackageModuleInfo(p.ImportPath)
+		if p.Name == "main" {
+			p.Internal.BuildInfo = vgo.PackageBuildInfo(p.ImportPath, p.Deps)
+		}
 	}
 }
 
@@ -1235,7 +1441,7 @@
 	deps := []string{"runtime"}
 
 	// External linking mode forces an import of runtime/cgo.
-	if externalLinkingForced(p) {
+	if externalLinkingForced(p) && cfg.BuildContext.Compiler != "gccgo" {
 		deps = append(deps, "runtime/cgo")
 	}
 	// On ARM with GOARM=5, it forces an import of math, for soft floating point.
@@ -1308,7 +1514,13 @@
 // InternalGoFiles returns the list of Go files being built for the package,
 // using absolute paths.
 func (p *Package) InternalGoFiles() []string {
-	return p.mkAbs(str.StringList(p.GoFiles, p.CgoFiles, p.TestGoFiles, p.XTestGoFiles))
+	return p.mkAbs(str.StringList(p.GoFiles, p.CgoFiles, p.TestGoFiles))
+}
+
+// InternalXGoFiles returns the list of Go files being built for the XTest package,
+// using absolute paths.
+func (p *Package) InternalXGoFiles() []string {
+	return p.mkAbs(p.XTestGoFiles)
 }
 
 // InternalGoFiles returns the list of all Go files possibly relevant for the package,
@@ -1501,6 +1713,7 @@
 	for _, pkg := range pkgs {
 		if pkg.Error != nil {
 			base.Errorf("can't load package: %s", pkg.Error)
+			printed[pkg.Error] = true
 		}
 		for _, err := range pkg.DepsErrors {
 			// Since these are errors in dependencies,
@@ -1613,147 +1826,3 @@
 
 	return pkg
 }
-
-// TestPackagesFor returns package structs ptest, the package p plus
-// its test files, and pxtest, the external tests of package p.
-// pxtest may be nil. If there are no test files, forceTest decides
-// whether this returns a new package struct or just returns p.
-func TestPackagesFor(p *Package, forceTest bool) (ptest, pxtest *Package, err error) {
-	var imports, ximports []*Package
-	var stk ImportStack
-	stk.Push(p.ImportPath + " (test)")
-	rawTestImports := str.StringList(p.TestImports)
-	for i, path := range p.TestImports {
-		p1 := LoadImport(path, p.Dir, p, &stk, p.Internal.Build.TestImportPos[path], UseVendor)
-		if p1.Error != nil {
-			return nil, nil, p1.Error
-		}
-		if len(p1.DepsErrors) > 0 {
-			err := p1.DepsErrors[0]
-			err.Pos = "" // show full import stack
-			return nil, nil, err
-		}
-		if str.Contains(p1.Deps, p.ImportPath) || p1.ImportPath == p.ImportPath {
-			// Same error that loadPackage returns (via reusePackage) in pkg.go.
-			// Can't change that code, because that code is only for loading the
-			// non-test copy of a package.
-			err := &PackageError{
-				ImportStack:   testImportStack(stk[0], p1, p.ImportPath),
-				Err:           "import cycle not allowed in test",
-				IsImportCycle: true,
-			}
-			return nil, nil, err
-		}
-		p.TestImports[i] = p1.ImportPath
-		imports = append(imports, p1)
-	}
-	stk.Pop()
-	stk.Push(p.ImportPath + "_test")
-	pxtestNeedsPtest := false
-	rawXTestImports := str.StringList(p.XTestImports)
-	for i, path := range p.XTestImports {
-		p1 := LoadImport(path, p.Dir, p, &stk, p.Internal.Build.XTestImportPos[path], UseVendor)
-		if p1.Error != nil {
-			return nil, nil, p1.Error
-		}
-		if len(p1.DepsErrors) > 0 {
-			err := p1.DepsErrors[0]
-			err.Pos = "" // show full import stack
-			return nil, nil, err
-		}
-		if p1.ImportPath == p.ImportPath {
-			pxtestNeedsPtest = true
-		} else {
-			ximports = append(ximports, p1)
-		}
-		p.XTestImports[i] = p1.ImportPath
-	}
-	stk.Pop()
-
-	// Test package.
-	if len(p.TestGoFiles) > 0 || forceTest {
-		ptest = new(Package)
-		*ptest = *p
-		ptest.GoFiles = nil
-		ptest.GoFiles = append(ptest.GoFiles, p.GoFiles...)
-		ptest.GoFiles = append(ptest.GoFiles, p.TestGoFiles...)
-		ptest.Target = ""
-		// Note: The preparation of the vet config requires that common
-		// indexes in ptest.Imports, ptest.Internal.Imports, and ptest.Internal.RawImports
-		// all line up (but RawImports can be shorter than the others).
-		// That is, for 0 ≤ i < len(RawImports),
-		// RawImports[i] is the import string in the program text,
-		// Imports[i] is the expanded import string (vendoring applied or relative path expanded away),
-		// and Internal.Imports[i] is the corresponding *Package.
-		// Any implicitly added imports appear in Imports and Internal.Imports
-		// but not RawImports (because they were not in the source code).
-		// We insert TestImports, imports, and rawTestImports at the start of
-		// these lists to preserve the alignment.
-		ptest.Imports = str.StringList(p.TestImports, p.Imports)
-		ptest.Internal.Imports = append(imports, p.Internal.Imports...)
-		ptest.Internal.RawImports = str.StringList(rawTestImports, p.Internal.RawImports)
-		ptest.Internal.ForceLibrary = true
-		ptest.Internal.Build = new(build.Package)
-		*ptest.Internal.Build = *p.Internal.Build
-		m := map[string][]token.Position{}
-		for k, v := range p.Internal.Build.ImportPos {
-			m[k] = append(m[k], v...)
-		}
-		for k, v := range p.Internal.Build.TestImportPos {
-			m[k] = append(m[k], v...)
-		}
-		ptest.Internal.Build.ImportPos = m
-	} else {
-		ptest = p
-	}
-
-	// External test package.
-	if len(p.XTestGoFiles) > 0 {
-		pxtest = &Package{
-			PackagePublic: PackagePublic{
-				Name:       p.Name + "_test",
-				ImportPath: p.ImportPath + "_test",
-				Root:       p.Root,
-				Dir:        p.Dir,
-				GoFiles:    p.XTestGoFiles,
-				Imports:    p.XTestImports,
-			},
-			Internal: PackageInternal{
-				LocalPrefix: p.Internal.LocalPrefix,
-				Build: &build.Package{
-					ImportPos: p.Internal.Build.XTestImportPos,
-				},
-				Imports:    ximports,
-				RawImports: rawXTestImports,
-
-				Asmflags:   p.Internal.Asmflags,
-				Gcflags:    p.Internal.Gcflags,
-				Ldflags:    p.Internal.Ldflags,
-				Gccgoflags: p.Internal.Gccgoflags,
-			},
-		}
-		if pxtestNeedsPtest {
-			pxtest.Internal.Imports = append(pxtest.Internal.Imports, ptest)
-		}
-	}
-
-	return ptest, pxtest, nil
-}
-
-func testImportStack(top string, p *Package, target string) []string {
-	stk := []string{top, p.ImportPath}
-Search:
-	for p.ImportPath != target {
-		for _, p1 := range p.Internal.Imports {
-			if p1.ImportPath == target || str.Contains(p1.Deps, target) {
-				stk = append(stk, p1.ImportPath)
-				p = p1
-				continue Search
-			}
-		}
-		// Can't happen, but in case it does...
-		stk = append(stk, "<lost path to cycle>")
-		break
-	}
-	return stk
-}
diff --git a/vendor/cmd/go/internal/load/test.go b/vendor/cmd/go/internal/load/test.go
new file mode 100644
index 0000000..0a13dfc
--- /dev/null
+++ b/vendor/cmd/go/internal/load/test.go
@@ -0,0 +1,632 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package load
+
+import (
+	"bytes"
+	"cmd/go/internal/base"
+	"cmd/go/internal/str"
+	"errors"
+	"fmt"
+	"go/ast"
+	"go/build"
+	"go/doc"
+	"go/parser"
+	"go/token"
+	"path/filepath"
+	"sort"
+	"strings"
+	"text/template"
+	"unicode"
+	"unicode/utf8"
+)
+
+var TestMainDeps = []string{
+	// Dependencies for testmain.
+	"os",
+	"testing",
+	"testing/internal/testdeps",
+}
+
+type TestCover struct {
+	Mode     string
+	Local    bool
+	Pkgs     []*Package
+	Paths    []string
+	Vars     []coverInfo
+	DeclVars func(string, ...string) map[string]*CoverVar
+}
+
+// TestPackagesFor returns three packages:
+//	- ptest, the package p compiled with added "package p" test files.
+//	- pxtest, the result of compiling any "package p_test" (external) test files.
+//	- pmain, the package main corresponding to the test binary (running tests in ptest and pxtest).
+//
+// If the package has no "package p_test" test files, pxtest will be nil.
+// If the non-test compilation of package p can be reused
+// (for example, if there are no "package p" test files and
+// package p need not be instrumented for coverage or any other reason),
+// then the returned ptest == p.
+func TestPackagesFor(p *Package, cover *TestCover) (pmain, ptest, pxtest *Package, err error) {
+	var imports, ximports []*Package
+	var stk ImportStack
+	stk.Push(p.ImportPath + " (test)")
+	rawTestImports := str.StringList(p.TestImports)
+	for i, path := range p.TestImports {
+		p1 := LoadImport(path, p.Dir, p, &stk, p.Internal.Build.TestImportPos[path], ResolveImport)
+		if p1.Error != nil {
+			return nil, nil, nil, p1.Error
+		}
+		if len(p1.DepsErrors) > 0 {
+			err := p1.DepsErrors[0]
+			err.Pos = "" // show full import stack
+			return nil, nil, nil, err
+		}
+		if str.Contains(p1.Deps, p.ImportPath) || p1.ImportPath == p.ImportPath {
+			// Same error that loadPackage returns (via reusePackage) in pkg.go.
+			// Can't change that code, because that code is only for loading the
+			// non-test copy of a package.
+			err := &PackageError{
+				ImportStack:   testImportStack(stk[0], p1, p.ImportPath),
+				Err:           "import cycle not allowed in test",
+				IsImportCycle: true,
+			}
+			return nil, nil, nil, err
+		}
+		p.TestImports[i] = p1.ImportPath
+		imports = append(imports, p1)
+	}
+	stk.Pop()
+	stk.Push(p.ImportPath + "_test")
+	pxtestNeedsPtest := false
+	rawXTestImports := str.StringList(p.XTestImports)
+	for i, path := range p.XTestImports {
+		p1 := LoadImport(path, p.Dir, p, &stk, p.Internal.Build.XTestImportPos[path], ResolveImport)
+		if p1.Error != nil {
+			return nil, nil, nil, p1.Error
+		}
+		if len(p1.DepsErrors) > 0 {
+			err := p1.DepsErrors[0]
+			err.Pos = "" // show full import stack
+			return nil, nil, nil, err
+		}
+		if p1.ImportPath == p.ImportPath {
+			pxtestNeedsPtest = true
+		} else {
+			ximports = append(ximports, p1)
+		}
+		p.XTestImports[i] = p1.ImportPath
+	}
+	stk.Pop()
+
+	// Test package.
+	if len(p.TestGoFiles) > 0 || p.Name == "main" || cover != nil && cover.Local {
+		ptest = new(Package)
+		*ptest = *p
+		ptest.ForTest = p.ImportPath
+		ptest.GoFiles = nil
+		ptest.GoFiles = append(ptest.GoFiles, p.GoFiles...)
+		ptest.GoFiles = append(ptest.GoFiles, p.TestGoFiles...)
+		ptest.Target = ""
+		// Note: The preparation of the vet config requires that common
+		// indexes in ptest.Imports, ptest.Internal.Imports, and ptest.Internal.RawImports
+		// all line up (but RawImports can be shorter than the others).
+		// That is, for 0 ≤ i < len(RawImports),
+		// RawImports[i] is the import string in the program text,
+		// Imports[i] is the expanded import string (vendoring applied or relative path expanded away),
+		// and Internal.Imports[i] is the corresponding *Package.
+		// Any implicitly added imports appear in Imports and Internal.Imports
+		// but not RawImports (because they were not in the source code).
+		// We insert TestImports, imports, and rawTestImports at the start of
+		// these lists to preserve the alignment.
+		ptest.Imports = str.StringList(p.TestImports, p.Imports)
+		ptest.Internal.Imports = append(imports, p.Internal.Imports...)
+		ptest.Internal.RawImports = str.StringList(rawTestImports, p.Internal.RawImports)
+		ptest.Internal.ForceLibrary = true
+		ptest.Internal.Build = new(build.Package)
+		*ptest.Internal.Build = *p.Internal.Build
+		m := map[string][]token.Position{}
+		for k, v := range p.Internal.Build.ImportPos {
+			m[k] = append(m[k], v...)
+		}
+		for k, v := range p.Internal.Build.TestImportPos {
+			m[k] = append(m[k], v...)
+		}
+		ptest.Internal.Build.ImportPos = m
+	} else {
+		ptest = p
+	}
+
+	// External test package.
+	if len(p.XTestGoFiles) > 0 {
+		pxtest = &Package{
+			PackagePublic: PackagePublic{
+				Name:       p.Name + "_test",
+				ImportPath: p.ImportPath + "_test",
+				Root:       p.Root,
+				Dir:        p.Dir,
+				GoFiles:    p.XTestGoFiles,
+				Imports:    p.XTestImports,
+				ForTest:    p.ImportPath,
+			},
+			Internal: PackageInternal{
+				LocalPrefix: p.Internal.LocalPrefix,
+				Build: &build.Package{
+					ImportPos: p.Internal.Build.XTestImportPos,
+				},
+				Imports:    ximports,
+				RawImports: rawXTestImports,
+
+				Asmflags:   p.Internal.Asmflags,
+				Gcflags:    p.Internal.Gcflags,
+				Ldflags:    p.Internal.Ldflags,
+				Gccgoflags: p.Internal.Gccgoflags,
+			},
+		}
+		if pxtestNeedsPtest {
+			pxtest.Internal.Imports = append(pxtest.Internal.Imports, ptest)
+		}
+	}
+
+	// Build main package.
+	pmain = &Package{
+		PackagePublic: PackagePublic{
+			Name:       "main",
+			Dir:        p.Dir,
+			GoFiles:    []string{"_testmain.go"},
+			ImportPath: p.ImportPath + ".test",
+			Root:       p.Root,
+		},
+		Internal: PackageInternal{
+			Build:      &build.Package{Name: "main"},
+			Asmflags:   p.Internal.Asmflags,
+			Gcflags:    p.Internal.Gcflags,
+			Ldflags:    p.Internal.Ldflags,
+			Gccgoflags: p.Internal.Gccgoflags,
+		},
+	}
+
+	// The generated main also imports testing, regexp, and os.
+	// Also the linker introduces implicit dependencies reported by LinkerDeps.
+	stk.Push("testmain")
+	deps := TestMainDeps // cap==len, so safe for append
+	for _, d := range LinkerDeps(p) {
+		deps = append(deps, d)
+	}
+	for _, dep := range deps {
+		if dep == ptest.ImportPath {
+			pmain.Internal.Imports = append(pmain.Internal.Imports, ptest)
+		} else {
+			p1 := LoadImport(dep, "", nil, &stk, nil, 0)
+			if p1.Error != nil {
+				return nil, nil, nil, p1.Error
+			}
+			pmain.Internal.Imports = append(pmain.Internal.Imports, p1)
+		}
+	}
+	stk.Pop()
+
+	if cover != nil && cover.Pkgs != nil {
+		// Add imports, but avoid duplicates.
+		seen := map[*Package]bool{p: true, ptest: true}
+		for _, p1 := range pmain.Internal.Imports {
+			seen[p1] = true
+		}
+		for _, p1 := range cover.Pkgs {
+			if !seen[p1] {
+				seen[p1] = true
+				pmain.Internal.Imports = append(pmain.Internal.Imports, p1)
+			}
+		}
+	}
+
+	// Do initial scan for metadata needed for writing _testmain.go
+	// Use that metadata to update the list of imports for package main.
+	// The list of imports is used by recompileForTest and by the loop
+	// afterward that gathers t.Cover information.
+	t, err := loadTestFuncs(ptest)
+	if err != nil {
+		return nil, nil, nil, err
+	}
+	t.Cover = cover
+	if len(ptest.GoFiles)+len(ptest.CgoFiles) > 0 {
+		pmain.Internal.Imports = append(pmain.Internal.Imports, ptest)
+		t.ImportTest = true
+	}
+	if pxtest != nil {
+		pmain.Internal.Imports = append(pmain.Internal.Imports, pxtest)
+		t.ImportXtest = true
+	}
+
+	if ptest != p {
+		// We have made modifications to the package p being tested
+		// and are rebuilding p (as ptest).
+		// Arrange to rebuild all packages q such that
+		// the test depends on q and q depends on p.
+		// This makes sure that q sees the modifications to p.
+		// Strictly speaking, the rebuild is only necessary if the
+		// modifications to p change its export metadata, but
+		// determining that is a bit tricky, so we rebuild always.
+		recompileForTest(pmain, p, ptest, pxtest)
+	}
+
+	// Should we apply coverage analysis locally,
+	// only for this package and only for this test?
+	// Yes, if -cover is on but -coverpkg has not specified
+	// a list of packages for global coverage.
+	if cover != nil && cover.Local {
+		ptest.Internal.CoverMode = cover.Mode
+		var coverFiles []string
+		coverFiles = append(coverFiles, ptest.GoFiles...)
+		coverFiles = append(coverFiles, ptest.CgoFiles...)
+		ptest.Internal.CoverVars = cover.DeclVars(ptest.ImportPath, coverFiles...)
+	}
+
+	for _, cp := range pmain.Internal.Imports {
+		if len(cp.Internal.CoverVars) > 0 {
+			t.Cover.Vars = append(t.Cover.Vars, coverInfo{cp, cp.Internal.CoverVars})
+		}
+	}
+
+	data, err := formatTestmain(t)
+	if err != nil {
+		return nil, nil, nil, err
+	}
+	pmain.Internal.TestmainGo = &data
+
+	return pmain, ptest, pxtest, nil
+}
+
+func testImportStack(top string, p *Package, target string) []string {
+	stk := []string{top, p.ImportPath}
+Search:
+	for p.ImportPath != target {
+		for _, p1 := range p.Internal.Imports {
+			if p1.ImportPath == target || str.Contains(p1.Deps, target) {
+				stk = append(stk, p1.ImportPath)
+				p = p1
+				continue Search
+			}
+		}
+		// Can't happen, but in case it does...
+		stk = append(stk, "<lost path to cycle>")
+		break
+	}
+	return stk
+}
+
+func recompileForTest(pmain, preal, ptest, pxtest *Package) {
+	// The "test copy" of preal is ptest.
+	// For each package that depends on preal, make a "test copy"
+	// that depends on ptest. And so on, up the dependency tree.
+	testCopy := map[*Package]*Package{preal: ptest}
+	for _, p := range PackageList([]*Package{pmain}) {
+		if p == preal {
+			continue
+		}
+		// Copy on write.
+		didSplit := p == pmain || p == pxtest
+		split := func() {
+			if didSplit {
+				return
+			}
+			didSplit = true
+			if testCopy[p] != nil {
+				panic("recompileForTest loop")
+			}
+			p1 := new(Package)
+			testCopy[p] = p1
+			*p1 = *p
+			p1.ForTest = preal.ImportPath
+			p1.Internal.Imports = make([]*Package, len(p.Internal.Imports))
+			copy(p1.Internal.Imports, p.Internal.Imports)
+			p = p1
+			p.Target = ""
+		}
+
+		// Update p.Internal.Imports to use test copies.
+		for i, imp := range p.Internal.Imports {
+			if p1 := testCopy[imp]; p1 != nil && p1 != imp {
+				split()
+				p.Internal.Imports[i] = p1
+			}
+		}
+	}
+}
+
+// isTestFunc tells whether fn has the type of a testing function. arg
+// specifies the parameter type we look for: B, M or T.
+func isTestFunc(fn *ast.FuncDecl, arg string) bool {
+	if fn.Type.Results != nil && len(fn.Type.Results.List) > 0 ||
+		fn.Type.Params.List == nil ||
+		len(fn.Type.Params.List) != 1 ||
+		len(fn.Type.Params.List[0].Names) > 1 {
+		return false
+	}
+	ptr, ok := fn.Type.Params.List[0].Type.(*ast.StarExpr)
+	if !ok {
+		return false
+	}
+	// We can't easily check that the type is *testing.M
+	// because we don't know how testing has been imported,
+	// but at least check that it's *M or *something.M.
+	// Same applies for B and T.
+	if name, ok := ptr.X.(*ast.Ident); ok && name.Name == arg {
+		return true
+	}
+	if sel, ok := ptr.X.(*ast.SelectorExpr); ok && sel.Sel.Name == arg {
+		return true
+	}
+	return false
+}
+
+// isTest tells whether name looks like a test (or benchmark, according to prefix).
+// It is a Test (say) if there is a character after Test that is not a lower-case letter.
+// We don't want TesticularCancer.
+func isTest(name, prefix string) bool {
+	if !strings.HasPrefix(name, prefix) {
+		return false
+	}
+	if len(name) == len(prefix) { // "Test" is ok
+		return true
+	}
+	rune, _ := utf8.DecodeRuneInString(name[len(prefix):])
+	return !unicode.IsLower(rune)
+}
+
+type coverInfo struct {
+	Package *Package
+	Vars    map[string]*CoverVar
+}
+
+// loadTestFuncs returns the testFuncs describing the tests that will be run.
+func loadTestFuncs(ptest *Package) (*testFuncs, error) {
+	t := &testFuncs{
+		Package: ptest,
+	}
+	for _, file := range ptest.TestGoFiles {
+		if err := t.load(filepath.Join(ptest.Dir, file), "_test", &t.ImportTest, &t.NeedTest); err != nil {
+			return nil, err
+		}
+	}
+	for _, file := range ptest.XTestGoFiles {
+		if err := t.load(filepath.Join(ptest.Dir, file), "_xtest", &t.ImportXtest, &t.NeedXtest); err != nil {
+			return nil, err
+		}
+	}
+	return t, nil
+}
+
+// formatTestmain returns the content of the _testmain.go file for t.
+func formatTestmain(t *testFuncs) ([]byte, error) {
+	var buf bytes.Buffer
+	if err := testmainTmpl.Execute(&buf, t); err != nil {
+		return nil, err
+	}
+	return buf.Bytes(), nil
+}
+
+type testFuncs struct {
+	Tests       []testFunc
+	Benchmarks  []testFunc
+	Examples    []testFunc
+	TestMain    *testFunc
+	Package     *Package
+	ImportTest  bool
+	NeedTest    bool
+	ImportXtest bool
+	NeedXtest   bool
+	Cover       *TestCover
+}
+
+// ImportPath returns the import path of the package being tested, if it is within GOPATH.
+// This is printed by the testing package when running benchmarks.
+func (t *testFuncs) ImportPath() string {
+	pkg := t.Package.ImportPath
+	if strings.HasPrefix(pkg, "_/") {
+		return ""
+	}
+	if pkg == "command-line-arguments" {
+		return ""
+	}
+	return pkg
+}
+
+// Covered returns a string describing which packages are being tested for coverage.
+// If the covered package is the same as the tested package, it returns the empty string.
+// Otherwise it is a comma-separated human-readable list of packages beginning with
+// " in", ready for use in the coverage message.
+func (t *testFuncs) Covered() string {
+	if t.Cover == nil || t.Cover.Paths == nil {
+		return ""
+	}
+	return " in " + strings.Join(t.Cover.Paths, ", ")
+}
+
+// Tested returns the name of the package being tested.
+func (t *testFuncs) Tested() string {
+	return t.Package.Name
+}
+
+type testFunc struct {
+	Package   string // imported package name (_test or _xtest)
+	Name      string // function name
+	Output    string // output, for examples
+	Unordered bool   // output is allowed to be unordered.
+}
+
+var testFileSet = token.NewFileSet()
+
+func (t *testFuncs) load(filename, pkg string, doImport, seen *bool) error {
+	f, err := parser.ParseFile(testFileSet, filename, nil, parser.ParseComments)
+	if err != nil {
+		return base.ExpandScanner(err)
+	}
+	for _, d := range f.Decls {
+		n, ok := d.(*ast.FuncDecl)
+		if !ok {
+			continue
+		}
+		if n.Recv != nil {
+			continue
+		}
+		name := n.Name.String()
+		switch {
+		case name == "TestMain":
+			if isTestFunc(n, "T") {
+				t.Tests = append(t.Tests, testFunc{pkg, name, "", false})
+				*doImport, *seen = true, true
+				continue
+			}
+			err := checkTestFunc(n, "M")
+			if err != nil {
+				return err
+			}
+			if t.TestMain != nil {
+				return errors.New("multiple definitions of TestMain")
+			}
+			t.TestMain = &testFunc{pkg, name, "", false}
+			*doImport, *seen = true, true
+		case isTest(name, "Test"):
+			err := checkTestFunc(n, "T")
+			if err != nil {
+				return err
+			}
+			t.Tests = append(t.Tests, testFunc{pkg, name, "", false})
+			*doImport, *seen = true, true
+		case isTest(name, "Benchmark"):
+			err := checkTestFunc(n, "B")
+			if err != nil {
+				return err
+			}
+			t.Benchmarks = append(t.Benchmarks, testFunc{pkg, name, "", false})
+			*doImport, *seen = true, true
+		}
+	}
+	ex := doc.Examples(f)
+	sort.Slice(ex, func(i, j int) bool { return ex[i].Order < ex[j].Order })
+	for _, e := range ex {
+		*doImport = true // import test file whether executed or not
+		if e.Output == "" && !e.EmptyOutput {
+			// Don't run examples with no output.
+			continue
+		}
+		t.Examples = append(t.Examples, testFunc{pkg, "Example" + e.Name, e.Output, e.Unordered})
+		*seen = true
+	}
+	return nil
+}
+
+func checkTestFunc(fn *ast.FuncDecl, arg string) error {
+	if !isTestFunc(fn, arg) {
+		name := fn.Name.String()
+		pos := testFileSet.Position(fn.Pos())
+		return fmt.Errorf("%s: wrong signature for %s, must be: func %s(%s *testing.%s)", pos, name, name, strings.ToLower(arg), arg)
+	}
+	return nil
+}
+
+var testmainTmpl = template.Must(template.New("main").Parse(`
+package main
+
+import (
+{{if not .TestMain}}
+	"os"
+{{end}}
+	"testing"
+	"testing/internal/testdeps"
+
+{{if .ImportTest}}
+	{{if .NeedTest}}_test{{else}}_{{end}} {{.Package.ImportPath | printf "%q"}}
+{{end}}
+{{if .ImportXtest}}
+	{{if .NeedXtest}}_xtest{{else}}_{{end}} {{.Package.ImportPath | printf "%s_test" | printf "%q"}}
+{{end}}
+{{if .Cover}}
+{{range $i, $p := .Cover.Vars}}
+	_cover{{$i}} {{$p.Package.ImportPath | printf "%q"}}
+{{end}}
+{{end}}
+)
+
+var tests = []testing.InternalTest{
+{{range .Tests}}
+	{"{{.Name}}", {{.Package}}.{{.Name}}},
+{{end}}
+}
+
+var benchmarks = []testing.InternalBenchmark{
+{{range .Benchmarks}}
+	{"{{.Name}}", {{.Package}}.{{.Name}}},
+{{end}}
+}
+
+var examples = []testing.InternalExample{
+{{range .Examples}}
+	{"{{.Name}}", {{.Package}}.{{.Name}}, {{.Output | printf "%q"}}, {{.Unordered}}},
+{{end}}
+}
+
+func init() {
+	testdeps.ImportPath = {{.ImportPath | printf "%q"}}
+}
+
+{{if .Cover}}
+
+// Only updated by init functions, so no need for atomicity.
+var (
+	coverCounters = make(map[string][]uint32)
+	coverBlocks = make(map[string][]testing.CoverBlock)
+)
+
+func init() {
+	{{range $i, $p := .Cover.Vars}}
+	{{range $file, $cover := $p.Vars}}
+	coverRegisterFile({{printf "%q" $cover.File}}, _cover{{$i}}.{{$cover.Var}}.Count[:], _cover{{$i}}.{{$cover.Var}}.Pos[:], _cover{{$i}}.{{$cover.Var}}.NumStmt[:])
+	{{end}}
+	{{end}}
+}
+
+func coverRegisterFile(fileName string, counter []uint32, pos []uint32, numStmts []uint16) {
+	if 3*len(counter) != len(pos) || len(counter) != len(numStmts) {
+		panic("coverage: mismatched sizes")
+	}
+	if coverCounters[fileName] != nil {
+		// Already registered.
+		return
+	}
+	coverCounters[fileName] = counter
+	block := make([]testing.CoverBlock, len(counter))
+	for i := range counter {
+		block[i] = testing.CoverBlock{
+			Line0: pos[3*i+0],
+			Col0: uint16(pos[3*i+2]),
+			Line1: pos[3*i+1],
+			Col1: uint16(pos[3*i+2]>>16),
+			Stmts: numStmts[i],
+		}
+	}
+	coverBlocks[fileName] = block
+}
+{{end}}
+
+func main() {
+{{if .Cover}}
+	testing.RegisterCover(testing.Cover{
+		Mode: {{printf "%q" .Cover.Mode}},
+		Counters: coverCounters,
+		Blocks: coverBlocks,
+		CoveredPackages: {{printf "%q" .Covered}},
+	})
+{{end}}
+	m := testing.MainStart(testdeps.TestDeps{}, tests, benchmarks, examples)
+{{with .TestMain}}
+	{{.Package}}.{{.Name}}(m)
+{{else}}
+	os.Exit(m.Run())
+{{end}}
+}
+
+`))
diff --git a/vendor/cmd/go/internal/modfetch/coderepo_test.go b/vendor/cmd/go/internal/modfetch/coderepo_test.go
index 80415b4..e3b106e 100644
--- a/vendor/cmd/go/internal/modfetch/coderepo_test.go
+++ b/vendor/cmd/go/internal/modfetch/coderepo_test.go
@@ -6,8 +6,7 @@
 
 import (
 	"archive/zip"
-	"cmd/go/internal/modfetch/codehost"
-	"cmd/go/internal/webtest"
+	"internal/testenv"
 	"io"
 	"io/ioutil"
 	"log"
@@ -16,6 +15,8 @@
 	"strings"
 	"testing"
 	"time"
+
+	"cmd/go/internal/modfetch/codehost"
 )
 
 func init() {
@@ -349,9 +350,7 @@
 }
 
 func TestCodeRepo(t *testing.T) {
-	webtest.LoadOnce("testdata/webtest.txt")
-	webtest.Hook()
-	defer webtest.Unhook()
+	testenv.MustHaveExternalNetwork(t)
 
 	tmpdir, err := ioutil.TempDir("", "vgo-modfetch-test-")
 	if err != nil {
@@ -479,9 +478,7 @@
 }
 
 func TestImport(t *testing.T) {
-	webtest.LoadOnce("testdata/webtest.txt")
-	webtest.Hook()
-	defer webtest.Unhook()
+	testenv.MustHaveExternalNetwork(t)
 
 	for _, tt := range importTests {
 		t.Run(strings.Replace(tt.path, "/", "_", -1), func(t *testing.T) {
@@ -536,9 +533,7 @@
 }
 
 func TestCodeRepoVersions(t *testing.T) {
-	webtest.LoadOnce("testdata/webtest.txt")
-	webtest.Hook()
-	defer webtest.Unhook()
+	testenv.MustHaveExternalNetwork(t)
 
 	tmpdir, err := ioutil.TempDir("", "vgo-modfetch-test-")
 	if err != nil {
@@ -582,9 +577,7 @@
 }
 
 func TestLatest(t *testing.T) {
-	webtest.LoadOnce("testdata/webtest.txt")
-	webtest.Hook()
-	defer webtest.Unhook()
+	testenv.MustHaveExternalNetwork(t)
 
 	tmpdir, err := ioutil.TempDir("", "vgo-modfetch-test-")
 	if err != nil {
diff --git a/vendor/cmd/go/internal/modfetch/convert_test.go b/vendor/cmd/go/internal/modfetch/convert_test.go
index 1901b46..03ae156 100644
--- a/vendor/cmd/go/internal/modfetch/convert_test.go
+++ b/vendor/cmd/go/internal/modfetch/convert_test.go
@@ -6,19 +6,17 @@
 
 import (
 	"bytes"
+	"internal/testenv"
 	"strings"
 	"testing"
 
 	"cmd/go/internal/cfg"
 	"cmd/go/internal/modconv"
 	"cmd/go/internal/modfile"
-	"cmd/go/internal/webtest"
 )
 
 func TestConvertLegacyConfig(t *testing.T) {
-	webtest.LoadOnce("testdata/webtest.txt")
-	webtest.Hook()
-	defer webtest.Unhook()
+	testenv.MustHaveExternalNetwork(t)
 
 	if testing.Verbose() {
 		old := cfg.BuildX
diff --git a/vendor/cmd/go/internal/modfetch/gitrepo/fetch_test.go b/vendor/cmd/go/internal/modfetch/gitrepo/fetch_test.go
index 5f0b6c9..ca93280 100644
--- a/vendor/cmd/go/internal/modfetch/gitrepo/fetch_test.go
+++ b/vendor/cmd/go/internal/modfetch/gitrepo/fetch_test.go
@@ -7,15 +7,19 @@
 import (
 	"archive/zip"
 	"bytes"
-	"cmd/go/internal/modfetch/codehost"
+	"fmt"
+	"internal/testenv"
 	"io/ioutil"
 	"log"
 	"os"
+	"os/exec"
 	"path/filepath"
 	"reflect"
 	"strings"
 	"testing"
 	"time"
+
+	"cmd/go/internal/modfetch/codehost"
 )
 
 func TestMain(m *testing.M) {
@@ -28,25 +32,33 @@
 var localGitRepo string
 
 func testMain(m *testing.M) int {
+	if _, err := exec.LookPath("git"); err != nil {
+		fmt.Fprintln(os.Stderr, "skipping because git binary not found")
+		fmt.Println("PASS")
+		return 0
+	}
+
 	dir, err := ioutil.TempDir("", "gitrepo-test-")
 	if err != nil {
 		log.Fatal(err)
 	}
 	defer os.RemoveAll(dir)
-
-	// Clone gitrepo1 into a local directory.
-	// If we use a file:// URL to access the local directory,
-	// then git starts up all the usual protocol machinery,
-	// which will let us test remote git archive invocations.
-	localGitRepo = filepath.Join(dir, "gitrepo2")
-	if _, err := codehost.Run("", "git", "clone", "--mirror", gitrepo1, localGitRepo); err != nil {
-		log.Fatal(err)
-	}
-	if _, err := codehost.Run(localGitRepo, "git", "config", "daemon.uploadarch", "true"); err != nil {
-		log.Fatal(err)
-	}
-
 	codehost.WorkRoot = dir
+
+	if testenv.HasExternalNetwork() && testenv.HasExec() {
+		// Clone gitrepo1 into a local directory.
+		// If we use a file:// URL to access the local directory,
+		// then git starts up all the usual protocol machinery,
+		// which will let us test remote git archive invocations.
+		localGitRepo = filepath.Join(dir, "gitrepo2")
+		if _, err := codehost.Run("", "git", "clone", "--mirror", gitrepo1, localGitRepo); err != nil {
+			log.Fatal(err)
+		}
+		if _, err := codehost.Run(localGitRepo, "git", "config", "daemon.uploadarch", "true"); err != nil {
+			log.Fatal(err)
+		}
+	}
+
 	return m.Run()
 }
 
@@ -72,6 +84,9 @@
 }
 
 func TestTags(t *testing.T) {
+	testenv.MustHaveExternalNetwork(t)
+	testenv.MustHaveExec(t)
+
 	for _, tt := range tagsTests {
 		f := func(t *testing.T) {
 			r, err := testRepo(tt.repo)
@@ -110,6 +125,9 @@
 }
 
 func TestLatest(t *testing.T) {
+	testenv.MustHaveExternalNetwork(t)
+	testenv.MustHaveExec(t)
+
 	for _, tt := range latestTests {
 		f := func(t *testing.T) {
 			r, err := testRepo(tt.repo)
@@ -160,6 +178,9 @@
 }
 
 func TestReadFile(t *testing.T) {
+	testenv.MustHaveExternalNetwork(t)
+	testenv.MustHaveExec(t)
+
 	for _, tt := range readFileTests {
 		f := func(t *testing.T) {
 			r, err := testRepo(tt.repo)
@@ -287,6 +308,9 @@
 }
 
 func TestReadZip(t *testing.T) {
+	testenv.MustHaveExternalNetwork(t)
+	testenv.MustHaveExec(t)
+
 	for _, tt := range readZipTests {
 		f := func(t *testing.T) {
 			r, err := testRepo(tt.repo)
@@ -441,6 +465,9 @@
 }
 
 func TestStat(t *testing.T) {
+	testenv.MustHaveExternalNetwork(t)
+	testenv.MustHaveExec(t)
+
 	for _, tt := range statTests {
 		f := func(t *testing.T) {
 			r, err := testRepo(tt.repo)
diff --git a/vendor/cmd/go/internal/modfile/rule.go b/vendor/cmd/go/internal/modfile/rule.go
index 9c50102..5a784a3 100644
--- a/vendor/cmd/go/internal/modfile/rule.go
+++ b/vendor/cmd/go/internal/modfile/rule.go
@@ -371,7 +371,7 @@
 	x.Syntax.Stmt = append(x.Syntax.Stmt, syntax)
 
 End:
-	x.Require = append(x.Require, &Require{module.Version{path, vers}, syntax})
+	x.Require = append(x.Require, &Require{module.Version{Path: path, Version: vers}, syntax})
 }
 
 func (f *File) SetRequire(req []module.Version) {
diff --git a/vendor/cmd/go/internal/run/run.go b/vendor/cmd/go/internal/run/run.go
index ce24748..8460d1f 100644
--- a/vendor/cmd/go/internal/run/run.go
+++ b/vendor/cmd/go/internal/run/run.go
@@ -18,11 +18,13 @@
 )
 
 var CmdRun = &base.Command{
-	UsageLine: "run [build flags] [-exec xprog] gofiles... [arguments...]",
+	UsageLine: "run [build flags] [-exec xprog] package [arguments...]",
 	Short:     "compile and run Go program",
 	Long: `
-Run compiles and runs the main package comprising the named Go source files.
-A Go source file is defined to be a file ending in a literal ".go" suffix.
+Run compiles and runs the named main Go package.
+Typically the package is specified as a list of .go source files,
+but it may also be an import path, file system path, or pattern
+matching a single known package, as in 'go run .' or 'go run my/cmd'.
 
 By default, 'go run' runs the compiled binary directly: 'a.out arguments...'.
 If the -exec flag is given, 'go run' invokes the binary using xprog:
@@ -34,7 +36,10 @@
 cross-compiled programs when a simulator or other execution method is
 available.
 
+The exit status of Run is not the exit status of the compiled binary.
+
 For more about build flags, see 'go help build'.
+For more about specifying packages, see 'go help packages'.
 
 See also: go build.
 	`,
@@ -60,18 +65,33 @@
 	for i < len(args) && strings.HasSuffix(args[i], ".go") {
 		i++
 	}
-	files, cmdArgs := args[:i], args[i:]
-	if len(files) == 0 {
+	var p *load.Package
+	if i > 0 {
+		files := args[:i]
+		for _, file := range files {
+			if strings.HasSuffix(file, "_test.go") {
+				// GoFilesPackage is going to assign this to TestGoFiles.
+				// Reject since it won't be part of the build.
+				base.Fatalf("go run: cannot run *_test.go files (%s)", file)
+			}
+		}
+		p = load.GoFilesPackage(files)
+	} else if len(args) > 0 && !strings.HasPrefix(args[0], "-") {
+		pkgs := load.PackagesAndErrors(args[:1])
+		if len(pkgs) > 1 {
+			var names []string
+			for _, p := range pkgs {
+				names = append(names, p.ImportPath)
+			}
+			base.Fatalf("go run: pattern %s matches multiple packages:\n\t%s", args[0], strings.Join(names, "\n\t"))
+		}
+		p = pkgs[0]
+		i++
+	} else {
 		base.Fatalf("go run: no go files listed")
 	}
-	for _, file := range files {
-		if strings.HasSuffix(file, "_test.go") {
-			// GoFilesPackage is going to assign this to TestGoFiles.
-			// Reject since it won't be part of the build.
-			base.Fatalf("go run: cannot run *_test.go files (%s)", file)
-		}
-	}
-	p := load.GoFilesPackage(files)
+	cmdArgs := args[i:]
+
 	if p.Error != nil {
 		base.Fatalf("%s", p.Error)
 	}
diff --git a/vendor/cmd/go/internal/test/cover.go b/vendor/cmd/go/internal/test/cover.go
index 12538b4..9841791 100644
--- a/vendor/cmd/go/internal/test/cover.go
+++ b/vendor/cmd/go/internal/test/cover.go
@@ -23,7 +23,7 @@
 // Using this function clears the profile in case it existed from a previous run,
 // or in case it doesn't exist and the test is going to fail to create it (or not run).
 func initCoverProfile() {
-	if testCoverProfile == "" {
+	if testCoverProfile == "" || testC {
 		return
 	}
 	if !filepath.IsAbs(testCoverProfile) && testOutputDir != "" {
diff --git a/vendor/cmd/go/internal/test/test.go b/vendor/cmd/go/internal/test/test.go
index 0a44058..aff5ff2 100644
--- a/vendor/cmd/go/internal/test/test.go
+++ b/vendor/cmd/go/internal/test/test.go
@@ -9,11 +9,7 @@
 	"crypto/sha256"
 	"errors"
 	"fmt"
-	"go/ast"
 	"go/build"
-	"go/doc"
-	"go/parser"
-	"go/token"
 	"io"
 	"io/ioutil"
 	"os"
@@ -25,10 +21,7 @@
 	"strconv"
 	"strings"
 	"sync"
-	"text/template"
 	"time"
-	"unicode"
-	"unicode/utf8"
 
 	"cmd/go/internal/base"
 	"cmd/go/internal/cache"
@@ -76,9 +69,12 @@
 
 As part of building a test binary, go test runs go vet on the package
 and its test source files to identify significant problems. If go vet
-finds any problems, go test reports those and does not run the test binary.
-Only a high-confidence subset of the default go vet checks are used.
-To disable the running of go vet, use the -vet=off flag.
+finds any problems, go test reports those and does not run the test
+binary. Only a high-confidence subset of the default go vet checks are
+used. That subset is: 'atomic', 'bool', 'buildtags', 'nilfunc', and
+'printf'. You can see the documentation for these and other vet tests
+via "go doc cmd/vet". To disable the running of go vet, use the
+-vet=off flag.
 
 All test output and summary lines are printed to the go command's
 standard output, even if the test printed them to its own standard
@@ -328,14 +324,13 @@
 	    Writes test binary as -c would.
 
 	-memprofile mem.out
-	    Write a memory profile to the file after all tests have passed.
+	    Write an allocation profile to the file after all tests have passed.
 	    Writes test binary as -c would.
 
 	-memprofilerate n
-	    Enable more precise (and expensive) memory profiles by setting
-	    runtime.MemProfileRate. See 'go doc runtime.MemProfileRate'.
-	    To profile all memory allocations, use -test.memprofilerate=1
-	    and pass --alloc_space flag to the pprof tool.
+	    Enable more precise (and expensive) memory allocation profiles by
+	    setting runtime.MemProfileRate. See 'go doc runtime.MemProfileRate'.
+	    To profile all memory allocations, use -test.memprofilerate=1.
 
 	-mutexprofile mutex.out
 	    Write a mutex contention profile to the specified file
@@ -385,6 +380,12 @@
 the package list would have to appear before -myflag, but could appear
 on either side of -v.
 
+When 'go test' runs in package list mode, 'go test' caches successful
+package test results to avoid unnecessary repeated running of tests. To
+disable test caching, use any test flag or argument other than the
+cacheable flags. The idiomatic way to disable test caching explicitly
+is to use -count=1.
+
 To keep an argument for a test binary from being interpreted as a
 known flag or a package name, use -args (see 'go help test') which
 passes the remainder of the command line through to the test binary
@@ -499,13 +500,6 @@
 	testCacheExpire time.Time // ignore cached test results before this time
 )
 
-var testMainDeps = []string{
-	// Dependencies for testmain.
-	"os",
-	"testing",
-	"testing/internal/testdeps",
-}
-
 // testVetFlags is the list of flags to pass to vet when invoked automatically during go test.
 var testVetFlags = []string{
 	// TODO(rsc): Decide which tests are enabled by default.
@@ -597,7 +591,7 @@
 		cfg.BuildV = testV
 
 		deps := make(map[string]bool)
-		for _, dep := range testMainDeps {
+		for _, dep := range load.TestMainDeps {
 			deps[dep] = true
 		}
 
@@ -606,10 +600,10 @@
 			for _, path := range p.Imports {
 				deps[path] = true
 			}
-			for _, path := range p.Vendored(p.TestImports) {
+			for _, path := range p.Resolve(p.TestImports) {
 				deps[path] = true
 			}
-			for _, path := range p.Vendored(p.XTestImports) {
+			for _, path := range p.Resolve(p.XTestImports) {
 				deps[path] = true
 			}
 		}
@@ -632,6 +626,11 @@
 
 		a := &work.Action{Mode: "go test -i"}
 		for _, p := range load.PackagesForBuild(all) {
+			if cfg.BuildToolchainName == "gccgo" && p.Standard {
+				// gccgo's standard library packages
+				// can not be reinstalled.
+				continue
+			}
 			a.Deps = append(a.Deps, b.CompileAction(work.ModeInstall, work.ModeInstall, p))
 		}
 		b.Do(a)
@@ -668,6 +667,14 @@
 				continue
 			}
 
+			// If using the race detector, silently ignore
+			// attempts to run coverage on the runtime
+			// packages. It will cause the race detector
+			// to be invoked before it has been initialized.
+			if cfg.BuildRace && p.Standard && (p.ImportPath == "runtime" || strings.HasPrefix(p.ImportPath, "runtime/internal")) {
+				continue
+			}
+
 			if haveMatch {
 				testCoverPkgs = append(testCoverPkgs, p)
 			}
@@ -708,9 +715,7 @@
 		buildTest, runTest, printTest, err := builderTest(&b, p)
 		if err != nil {
 			str := err.Error()
-			if strings.HasPrefix(str, "\n") {
-				str = str[1:]
-			}
+			str = strings.TrimPrefix(str, "\n")
 			failed := fmt.Sprintf("FAIL\t%s [setup failed]\n", p.ImportPath)
 
 			if p.ImportPath != "" {
@@ -776,23 +781,21 @@
 }
 
 func builderTest(b *work.Builder, p *load.Package) (buildAction, runAction, printAction *work.Action, err error) {
-	if len(p.TestGoFiles)+len(p.XTestGoFiles) == 0 {
-		build := b.CompileAction(work.ModeBuild, work.ModeBuild, p)
-		run := &work.Action{Mode: "test run", Package: p, Deps: []*work.Action{build}}
-		addTestVet(b, p, run, nil)
-		print := &work.Action{Mode: "test print", Func: builderNoTest, Package: p, Deps: []*work.Action{run}}
-		return build, run, print, nil
-	}
-
 	// Build Package structs describing:
+	//	pmain - pkg.test binary
 	//	ptest - package + test files
 	//	pxtest - package of external test files
-	//	pmain - pkg.test binary
-	var ptest, pxtest, pmain *load.Package
-
-	localCover := testCover && testCoverPaths == nil
-
-	ptest, pxtest, err = load.TestPackagesFor(p, localCover || p.Name == "main")
+	var cover *load.TestCover
+	if testCover {
+		cover = &load.TestCover{
+			Mode:     testCoverMode,
+			Local:    testCover && testCoverPaths == nil,
+			Pkgs:     testCoverPkgs,
+			Paths:    testCoverPaths,
+			DeclVars: declareCoverVars,
+		}
+	}
+	pmain, ptest, pxtest, err := load.TestPackagesFor(p, cover)
 	if err != nil {
 		return nil, nil, nil, err
 	}
@@ -809,116 +812,18 @@
 	}
 	testBinary := elem + ".test"
 
-	// Should we apply coverage analysis locally,
-	// only for this package and only for this test?
-	// Yes, if -cover is on but -coverpkg has not specified
-	// a list of packages for global coverage.
-	if localCover {
-		ptest.Internal.CoverMode = testCoverMode
-		var coverFiles []string
-		coverFiles = append(coverFiles, ptest.GoFiles...)
-		coverFiles = append(coverFiles, ptest.CgoFiles...)
-		ptest.Internal.CoverVars = declareCoverVars(ptest.ImportPath, coverFiles...)
-	}
-
 	testDir := b.NewObjdir()
 	if err := b.Mkdir(testDir); err != nil {
 		return nil, nil, nil, err
 	}
 
-	// Action for building pkg.test.
-	pmain = &load.Package{
-		PackagePublic: load.PackagePublic{
-			Name:       "main",
-			Dir:        testDir,
-			GoFiles:    []string{"_testmain.go"},
-			ImportPath: p.ImportPath + " (testmain)",
-			Root:       p.Root,
-		},
-		Internal: load.PackageInternal{
-			Build:     &build.Package{Name: "main"},
-			OmitDebug: !testC && !testNeedBinary,
-
-			Asmflags:   p.Internal.Asmflags,
-			Gcflags:    p.Internal.Gcflags,
-			Ldflags:    p.Internal.Ldflags,
-			Gccgoflags: p.Internal.Gccgoflags,
-		},
-	}
-
-	// The generated main also imports testing, regexp, and os.
-	// Also the linker introduces implicit dependencies reported by LinkerDeps.
-	var stk load.ImportStack
-	stk.Push("testmain")
-	deps := testMainDeps // cap==len, so safe for append
-	for _, d := range load.LinkerDeps(p) {
-		deps = append(deps, d)
-	}
-	for _, dep := range deps {
-		if dep == ptest.ImportPath {
-			pmain.Internal.Imports = append(pmain.Internal.Imports, ptest)
-		} else {
-			p1 := load.LoadImport(dep, "", nil, &stk, nil, 0)
-			if p1.Error != nil {
-				return nil, nil, nil, p1.Error
-			}
-			pmain.Internal.Imports = append(pmain.Internal.Imports, p1)
-		}
-	}
-
-	if testCoverPkgs != nil {
-		// Add imports, but avoid duplicates.
-		seen := map[*load.Package]bool{p: true, ptest: true}
-		for _, p1 := range pmain.Internal.Imports {
-			seen[p1] = true
-		}
-		for _, p1 := range testCoverPkgs {
-			if !seen[p1] {
-				seen[p1] = true
-				pmain.Internal.Imports = append(pmain.Internal.Imports, p1)
-			}
-		}
-	}
-
-	// Do initial scan for metadata needed for writing _testmain.go
-	// Use that metadata to update the list of imports for package main.
-	// The list of imports is used by recompileForTest and by the loop
-	// afterward that gathers t.Cover information.
-	t, err := loadTestFuncs(ptest)
-	if err != nil {
-		return nil, nil, nil, err
-	}
-	if len(ptest.GoFiles)+len(ptest.CgoFiles) > 0 {
-		pmain.Internal.Imports = append(pmain.Internal.Imports, ptest)
-		t.ImportTest = true
-	}
-	if pxtest != nil {
-		pmain.Internal.Imports = append(pmain.Internal.Imports, pxtest)
-		t.ImportXtest = true
-	}
-
-	if ptest != p {
-		// We have made modifications to the package p being tested
-		// and are rebuilding p (as ptest).
-		// Arrange to rebuild all packages q such that
-		// the test depends on q and q depends on p.
-		// This makes sure that q sees the modifications to p.
-		// Strictly speaking, the rebuild is only necessary if the
-		// modifications to p change its export metadata, but
-		// determining that is a bit tricky, so we rebuild always.
-		recompileForTest(pmain, p, ptest, pxtest)
-	}
-
-	for _, cp := range pmain.Internal.Imports {
-		if len(cp.Internal.CoverVars) > 0 {
-			t.Cover = append(t.Cover, coverInfo{cp, cp.Internal.CoverVars})
-		}
-	}
+	pmain.Dir = testDir
+	pmain.Internal.OmitDebug = !testC && !testNeedBinary
 
 	if !cfg.BuildN {
 		// writeTestmain writes _testmain.go,
 		// using the test description gathered in t.
-		if err := writeTestmain(testDir+"_testmain.go", t); err != nil {
+		if err := ioutil.WriteFile(testDir+"_testmain.go", *pmain.Internal.TestmainGo, 0666); err != nil {
 			return nil, nil, nil, err
 		}
 	}
@@ -1044,44 +949,6 @@
 	}
 }
 
-func recompileForTest(pmain, preal, ptest, pxtest *load.Package) {
-	// The "test copy" of preal is ptest.
-	// For each package that depends on preal, make a "test copy"
-	// that depends on ptest. And so on, up the dependency tree.
-	testCopy := map[*load.Package]*load.Package{preal: ptest}
-	for _, p := range load.PackageList([]*load.Package{pmain}) {
-		if p == preal {
-			continue
-		}
-		// Copy on write.
-		didSplit := p == pmain || p == pxtest
-		split := func() {
-			if didSplit {
-				return
-			}
-			didSplit = true
-			if testCopy[p] != nil {
-				panic("recompileForTest loop")
-			}
-			p1 := new(load.Package)
-			testCopy[p] = p1
-			*p1 = *p
-			p1.Internal.Imports = make([]*load.Package, len(p.Internal.Imports))
-			copy(p1.Internal.Imports, p.Internal.Imports)
-			p = p1
-			p.Target = ""
-		}
-
-		// Update p.Internal.Imports to use test copies.
-		for i, imp := range p.Internal.Imports {
-			if p1 := testCopy[imp]; p1 != nil && p1 != imp {
-				split()
-				p.Internal.Imports[i] = p1
-			}
-		}
-	}
-}
-
 // isTestFile reports whether the source file is a set of tests and should therefore
 // be excluded from coverage analysis.
 func isTestFile(file string) bool {
@@ -1301,13 +1168,17 @@
 
 	if err == nil {
 		norun := ""
+		res := "ok"
 		if !testShowPass && !testJSON {
 			buf.Reset()
 		}
-		if bytes.HasPrefix(out, noTestsToRun[1:]) || bytes.Contains(out, noTestsToRun) {
+		if len(a.Package.TestGoFiles)+len(a.Package.XTestGoFiles) == 0 {
+			res = "? "
+			norun = " [no test files]"
+		} else if bytes.HasPrefix(out, noTestsToRun[1:]) || bytes.Contains(out, noTestsToRun) {
 			norun = " [no tests to run]"
 		}
-		fmt.Fprintf(cmd.Stdout, "ok  \t%s\t%s%s%s\n", a.Package.ImportPath, t, coveragePercentage(out), norun)
+		fmt.Fprintf(cmd.Stdout, "%s  \t%s\t%s%s%s\n", res, a.Package.ImportPath, t, coveragePercentage(out), norun)
 		c.saveOutput(a)
 	} else {
 		base.SetExitStatus(1)
@@ -1525,7 +1396,7 @@
 			fmt.Fprintf(h, "env %s %x\n", name, hashGetenv(name))
 		case "chdir":
 			pwd = name // always absolute
-			fmt.Fprintf(h, "cbdir %s %x\n", name, hashStat(name))
+			fmt.Fprintf(h, "chdir %s %x\n", name, hashStat(name))
 		case "stat":
 			if !filepath.IsAbs(name) {
 				name = filepath.Join(pwd, name)
@@ -1721,318 +1592,3 @@
 	}
 	return nil
 }
-
-// builderNoTest is the action for testing a package with no test files.
-func builderNoTest(b *work.Builder, a *work.Action) error {
-	var stdout io.Writer = os.Stdout
-	if testJSON {
-		json := test2json.NewConverter(lockedStdout{}, a.Package.ImportPath, test2json.Timestamp)
-		defer json.Close()
-		stdout = json
-	}
-	fmt.Fprintf(stdout, "?   \t%s\t[no test files]\n", a.Package.ImportPath)
-	return nil
-}
-
-// isTestFunc tells whether fn has the type of a testing function. arg
-// specifies the parameter type we look for: B, M or T.
-func isTestFunc(fn *ast.FuncDecl, arg string) bool {
-	if fn.Type.Results != nil && len(fn.Type.Results.List) > 0 ||
-		fn.Type.Params.List == nil ||
-		len(fn.Type.Params.List) != 1 ||
-		len(fn.Type.Params.List[0].Names) > 1 {
-		return false
-	}
-	ptr, ok := fn.Type.Params.List[0].Type.(*ast.StarExpr)
-	if !ok {
-		return false
-	}
-	// We can't easily check that the type is *testing.M
-	// because we don't know how testing has been imported,
-	// but at least check that it's *M or *something.M.
-	// Same applies for B and T.
-	if name, ok := ptr.X.(*ast.Ident); ok && name.Name == arg {
-		return true
-	}
-	if sel, ok := ptr.X.(*ast.SelectorExpr); ok && sel.Sel.Name == arg {
-		return true
-	}
-	return false
-}
-
-// isTest tells whether name looks like a test (or benchmark, according to prefix).
-// It is a Test (say) if there is a character after Test that is not a lower-case letter.
-// We don't want TesticularCancer.
-func isTest(name, prefix string) bool {
-	if !strings.HasPrefix(name, prefix) {
-		return false
-	}
-	if len(name) == len(prefix) { // "Test" is ok
-		return true
-	}
-	rune, _ := utf8.DecodeRuneInString(name[len(prefix):])
-	return !unicode.IsLower(rune)
-}
-
-type coverInfo struct {
-	Package *load.Package
-	Vars    map[string]*load.CoverVar
-}
-
-// loadTestFuncs returns the testFuncs describing the tests that will be run.
-func loadTestFuncs(ptest *load.Package) (*testFuncs, error) {
-	t := &testFuncs{
-		Package: ptest,
-	}
-	for _, file := range ptest.TestGoFiles {
-		if err := t.load(filepath.Join(ptest.Dir, file), "_test", &t.ImportTest, &t.NeedTest); err != nil {
-			return nil, err
-		}
-	}
-	for _, file := range ptest.XTestGoFiles {
-		if err := t.load(filepath.Join(ptest.Dir, file), "_xtest", &t.ImportXtest, &t.NeedXtest); err != nil {
-			return nil, err
-		}
-	}
-	return t, nil
-}
-
-// writeTestmain writes the _testmain.go file for t to the file named out.
-func writeTestmain(out string, t *testFuncs) error {
-	f, err := os.Create(out)
-	if err != nil {
-		return err
-	}
-	defer f.Close()
-
-	return testmainTmpl.Execute(f, t)
-}
-
-type testFuncs struct {
-	Tests       []testFunc
-	Benchmarks  []testFunc
-	Examples    []testFunc
-	TestMain    *testFunc
-	Package     *load.Package
-	ImportTest  bool
-	NeedTest    bool
-	ImportXtest bool
-	NeedXtest   bool
-	Cover       []coverInfo
-}
-
-func (t *testFuncs) CoverMode() string {
-	return testCoverMode
-}
-
-func (t *testFuncs) CoverEnabled() bool {
-	return testCover
-}
-
-// ImportPath returns the import path of the package being tested, if it is within GOPATH.
-// This is printed by the testing package when running benchmarks.
-func (t *testFuncs) ImportPath() string {
-	pkg := t.Package.ImportPath
-	if strings.HasPrefix(pkg, "_/") {
-		return ""
-	}
-	if pkg == "command-line-arguments" {
-		return ""
-	}
-	return pkg
-}
-
-// Covered returns a string describing which packages are being tested for coverage.
-// If the covered package is the same as the tested package, it returns the empty string.
-// Otherwise it is a comma-separated human-readable list of packages beginning with
-// " in", ready for use in the coverage message.
-func (t *testFuncs) Covered() string {
-	if testCoverPaths == nil {
-		return ""
-	}
-	return " in " + strings.Join(testCoverPaths, ", ")
-}
-
-// Tested returns the name of the package being tested.
-func (t *testFuncs) Tested() string {
-	return t.Package.Name
-}
-
-type testFunc struct {
-	Package   string // imported package name (_test or _xtest)
-	Name      string // function name
-	Output    string // output, for examples
-	Unordered bool   // output is allowed to be unordered.
-}
-
-var testFileSet = token.NewFileSet()
-
-func (t *testFuncs) load(filename, pkg string, doImport, seen *bool) error {
-	f, err := parser.ParseFile(testFileSet, filename, nil, parser.ParseComments)
-	if err != nil {
-		return base.ExpandScanner(err)
-	}
-	for _, d := range f.Decls {
-		n, ok := d.(*ast.FuncDecl)
-		if !ok {
-			continue
-		}
-		if n.Recv != nil {
-			continue
-		}
-		name := n.Name.String()
-		switch {
-		case name == "TestMain":
-			if isTestFunc(n, "T") {
-				t.Tests = append(t.Tests, testFunc{pkg, name, "", false})
-				*doImport, *seen = true, true
-				continue
-			}
-			err := checkTestFunc(n, "M")
-			if err != nil {
-				return err
-			}
-			if t.TestMain != nil {
-				return errors.New("multiple definitions of TestMain")
-			}
-			t.TestMain = &testFunc{pkg, name, "", false}
-			*doImport, *seen = true, true
-		case isTest(name, "Test"):
-			err := checkTestFunc(n, "T")
-			if err != nil {
-				return err
-			}
-			t.Tests = append(t.Tests, testFunc{pkg, name, "", false})
-			*doImport, *seen = true, true
-		case isTest(name, "Benchmark"):
-			err := checkTestFunc(n, "B")
-			if err != nil {
-				return err
-			}
-			t.Benchmarks = append(t.Benchmarks, testFunc{pkg, name, "", false})
-			*doImport, *seen = true, true
-		}
-	}
-	ex := doc.Examples(f)
-	sort.Slice(ex, func(i, j int) bool { return ex[i].Order < ex[j].Order })
-	for _, e := range ex {
-		*doImport = true // import test file whether executed or not
-		if e.Output == "" && !e.EmptyOutput {
-			// Don't run examples with no output.
-			continue
-		}
-		t.Examples = append(t.Examples, testFunc{pkg, "Example" + e.Name, e.Output, e.Unordered})
-		*seen = true
-	}
-	return nil
-}
-
-func checkTestFunc(fn *ast.FuncDecl, arg string) error {
-	if !isTestFunc(fn, arg) {
-		name := fn.Name.String()
-		pos := testFileSet.Position(fn.Pos())
-		return fmt.Errorf("%s: wrong signature for %s, must be: func %s(%s *testing.%s)", pos, name, name, strings.ToLower(arg), arg)
-	}
-	return nil
-}
-
-var testmainTmpl = template.Must(template.New("main").Parse(`
-package main
-
-import (
-{{if not .TestMain}}
-	"os"
-{{end}}
-	"testing"
-	"testing/internal/testdeps"
-
-{{if .ImportTest}}
-	{{if .NeedTest}}_test{{else}}_{{end}} {{.Package.ImportPath | printf "%q"}}
-{{end}}
-{{if .ImportXtest}}
-	{{if .NeedXtest}}_xtest{{else}}_{{end}} {{.Package.ImportPath | printf "%s_test" | printf "%q"}}
-{{end}}
-{{range $i, $p := .Cover}}
-	_cover{{$i}} {{$p.Package.ImportPath | printf "%q"}}
-{{end}}
-)
-
-var tests = []testing.InternalTest{
-{{range .Tests}}
-	{"{{.Name}}", {{.Package}}.{{.Name}}},
-{{end}}
-}
-
-var benchmarks = []testing.InternalBenchmark{
-{{range .Benchmarks}}
-	{"{{.Name}}", {{.Package}}.{{.Name}}},
-{{end}}
-}
-
-var examples = []testing.InternalExample{
-{{range .Examples}}
-	{"{{.Name}}", {{.Package}}.{{.Name}}, {{.Output | printf "%q"}}, {{.Unordered}}},
-{{end}}
-}
-
-func init() {
-	testdeps.ImportPath = {{.ImportPath | printf "%q"}}
-}
-
-{{if .CoverEnabled}}
-
-// Only updated by init functions, so no need for atomicity.
-var (
-	coverCounters = make(map[string][]uint32)
-	coverBlocks = make(map[string][]testing.CoverBlock)
-)
-
-func init() {
-	{{range $i, $p := .Cover}}
-	{{range $file, $cover := $p.Vars}}
-	coverRegisterFile({{printf "%q" $cover.File}}, _cover{{$i}}.{{$cover.Var}}.Count[:], _cover{{$i}}.{{$cover.Var}}.Pos[:], _cover{{$i}}.{{$cover.Var}}.NumStmt[:])
-	{{end}}
-	{{end}}
-}
-
-func coverRegisterFile(fileName string, counter []uint32, pos []uint32, numStmts []uint16) {
-	if 3*len(counter) != len(pos) || len(counter) != len(numStmts) {
-		panic("coverage: mismatched sizes")
-	}
-	if coverCounters[fileName] != nil {
-		// Already registered.
-		return
-	}
-	coverCounters[fileName] = counter
-	block := make([]testing.CoverBlock, len(counter))
-	for i := range counter {
-		block[i] = testing.CoverBlock{
-			Line0: pos[3*i+0],
-			Col0: uint16(pos[3*i+2]),
-			Line1: pos[3*i+1],
-			Col1: uint16(pos[3*i+2]>>16),
-			Stmts: numStmts[i],
-		}
-	}
-	coverBlocks[fileName] = block
-}
-{{end}}
-
-func main() {
-{{if .CoverEnabled}}
-	testing.RegisterCover(testing.Cover{
-		Mode: {{printf "%q" .CoverMode}},
-		Counters: coverCounters,
-		Blocks: coverBlocks,
-		CoveredPackages: {{printf "%q" .Covered}},
-	})
-{{end}}
-	m := testing.MainStart(testdeps.TestDeps{}, tests, benchmarks, examples)
-{{with .TestMain}}
-	{{.Package}}.{{.Name}}(m)
-{{else}}
-	os.Exit(m.Run())
-{{end}}
-}
-
-`))
diff --git a/vendor/cmd/go/internal/tool/tool.go b/vendor/cmd/go/internal/tool/tool.go
index db92884..4c7d089 100644
--- a/vendor/cmd/go/internal/tool/tool.go
+++ b/vendor/cmd/go/internal/tool/tool.go
@@ -33,6 +33,17 @@
 
 var toolN bool
 
+// Return whether tool can be expected in the gccgo tool directory.
+// Other binaries could be in the same directory so don't
+// show those with the 'go tool' command.
+func isGccgoTool(tool string) bool {
+	switch tool {
+	case "cgo", "fix", "cover", "godoc", "vet":
+		return true
+	}
+	return false
+}
+
 func init() {
 	CmdTool.Flag.BoolVar(&toolN, "n", false, "")
 }
@@ -114,6 +125,11 @@
 		if base.ToolIsWindows && strings.HasSuffix(name, base.ToolWindowsExtension) {
 			name = name[:len(name)-len(base.ToolWindowsExtension)]
 		}
+		// The tool directory used by gccgo will have other binaries
+		// in addition to go tools. Only display go tools here.
+		if cfg.BuildToolchainName == "gccgo" && !isGccgoTool(name) {
+			continue
+		}
 		fmt.Println(name)
 	}
 }
diff --git a/vendor/cmd/go/internal/vet/vet.go b/vendor/cmd/go/internal/vet/vet.go
index 3d095d4..9cb2aaa 100644
--- a/vendor/cmd/go/internal/vet/vet.go
+++ b/vendor/cmd/go/internal/vet/vet.go
@@ -57,16 +57,16 @@
 
 	root := &work.Action{Mode: "go vet"}
 	for _, p := range pkgs {
-		ptest, pxtest, err := load.TestPackagesFor(p, false)
+		_, ptest, pxtest, err := load.TestPackagesFor(p, nil)
 		if err != nil {
 			base.Errorf("%v", err)
 			continue
 		}
-		if len(ptest.GoFiles) == 0 && pxtest == nil {
+		if len(ptest.GoFiles) == 0 && len(ptest.CgoFiles) == 0 && pxtest == nil {
 			base.Errorf("go vet %s: no Go files in %s", p.ImportPath, p.Dir)
 			continue
 		}
-		if len(ptest.GoFiles) > 0 {
+		if len(ptest.GoFiles) > 0 || len(ptest.CgoFiles) > 0 {
 			root.Deps = append(root.Deps, b.VetAction(work.ModeBuild, work.ModeBuild, ptest))
 		}
 		if pxtest != nil {
diff --git a/vendor/cmd/go/internal/vet/vetflag.go b/vendor/cmd/go/internal/vet/vetflag.go
index d4664cc..bdfe033 100644
--- a/vendor/cmd/go/internal/vet/vetflag.go
+++ b/vendor/cmd/go/internal/vet/vetflag.go
@@ -90,7 +90,7 @@
 			}
 			switch f.Name {
 			// Flags known to the build but not to vet, so must be dropped.
-			case "x", "n", "vettool":
+			case "a", "x", "n", "vettool", "compiler":
 				if extraWord {
 					args = append(args[:i], args[i+2:]...)
 					extraWord = false
diff --git a/vendor/cmd/go/internal/vgo/build.go b/vendor/cmd/go/internal/vgo/build.go
index eeb5b7a..ba10309 100644
--- a/vendor/cmd/go/internal/vgo/build.go
+++ b/vendor/cmd/go/internal/vgo/build.go
@@ -34,16 +34,16 @@
 	return false
 }
 
-func PackageModuleInfo(path string) modinfo.ModulePublic {
+func PackageModuleInfo(path string) *modinfo.ModulePublic {
 	var info modinfo.ModulePublic
 	if isStandardImportPath(path) || !Enabled() {
-		return info
+		return nil
 	}
 	target := findModule(path, path)
 	info.Top = target.Path == buildList[0].Path
 	info.Path = target.Path
 	info.Version = target.Version
-	return info
+	return &info
 }
 
 func PackageBuildInfo(path string, deps []string) string {
diff --git a/vendor/cmd/go/internal/work/action.go b/vendor/cmd/go/internal/work/action.go
index 9f1f8f8..8edf55f 100644
--- a/vendor/cmd/go/internal/work/action.go
+++ b/vendor/cmd/go/internal/work/action.go
@@ -36,7 +36,10 @@
 	flagCache   map[[2]string]bool   // a cache of supported compiler flags
 	Print       func(args ...interface{}) (int, error)
 
-	ComputeStaleOnly bool // compute staleness for go list; no actual build
+	IsCmdList    bool // running as part of go list; set p.Stale and additional fields below
+	NeedError    bool // list needs p.Error
+	NeedExport   bool // list needs p.Export
+	NeedCgoFiles bool // list needs p.CgoFiles to cgo-generated files, not originals
 
 	objdirSeq int // counter for NewObjdir
 	pkgSeq    int
@@ -79,9 +82,10 @@
 	actionID cache.ActionID // cache ID of action input
 	buildID  string         // build ID of action output
 
-	needVet bool       // Mode=="build": need to fill in vet config
-	vetCfg  *vetConfig // vet config
-	output  []byte     // output redirect buffer (nil means use b.Print)
+	VetxOnly bool       // Mode=="vet": only being called to supply info about dependencies
+	needVet  bool       // Mode=="build": need to fill in vet config
+	vetCfg   *vetConfig // vet config
+	output   []byte     // output redirect buffer (nil means use b.Print)
 
 	// Execution state.
 	pending  int  // number of deps yet to complete
@@ -138,6 +142,7 @@
 	Priority   int      `json:",omitempty"`
 	Failed     bool     `json:",omitempty"`
 	Built      string   `json:",omitempty"`
+	VetxOnly   bool     `json:",omitempty"`
 }
 
 // cacheKey is the key for the action cache.
@@ -177,6 +182,7 @@
 			Failed:     a.Failed,
 			Priority:   a.priority,
 			Built:      a.built,
+			VetxOnly:   a.VetxOnly,
 		}
 		if a.Package != nil {
 			// TODO(rsc): Make this a unique key for a.Package somehow.
@@ -223,6 +229,10 @@
 		if err != nil {
 			base.Fatalf("%s", err)
 		}
+		if !filepath.IsAbs(b.WorkDir) {
+			os.RemoveAll(b.WorkDir)
+			base.Fatalf("cmd/go: relative tmpdir not supported")
+		}
 		if cfg.BuildX || cfg.BuildWork {
 			fmt.Fprintf(os.Stderr, "WORK=%s\n", b.WorkDir)
 		}
@@ -335,8 +345,10 @@
 			Objdir:  b.NewObjdir(),
 		}
 
-		for _, p1 := range p.Internal.Imports {
-			a.Deps = append(a.Deps, b.CompileAction(depMode, depMode, p1))
+		if p.Error == nil || !p.Error.IsImportCycle {
+			for _, p1 := range p.Internal.Imports {
+				a.Deps = append(a.Deps, b.CompileAction(depMode, depMode, p1))
+			}
 		}
 
 		if p.Standard {
@@ -374,6 +386,12 @@
 // If the caller may be causing p to be installed, it is up to the caller
 // to make sure that the install depends on (runs after) vet.
 func (b *Builder) VetAction(mode, depMode BuildMode, p *load.Package) *Action {
+	a := b.vetAction(mode, depMode, p)
+	a.VetxOnly = false
+	return a
+}
+
+func (b *Builder) vetAction(mode, depMode BuildMode, p *load.Package) *Action {
 	// Construct vet action.
 	a := b.cacheAction("vet", p, func() *Action {
 		a1 := b.CompileAction(mode, depMode, p)
@@ -385,11 +403,18 @@
 		stk.Pop()
 		aFmt := b.CompileAction(ModeBuild, depMode, p1)
 
+		deps := []*Action{a1, aFmt}
+		for _, p1 := range load.PackageList(p.Internal.Imports) {
+			deps = append(deps, b.vetAction(mode, depMode, p1))
+		}
+
 		a := &Action{
-			Mode:    "vet",
-			Package: p,
-			Deps:    []*Action{a1, aFmt},
-			Objdir:  a1.Objdir,
+			Mode:       "vet",
+			Package:    p,
+			Deps:       deps,
+			Objdir:     a1.Objdir,
+			VetxOnly:   true,
+			IgnoreFail: true, // it's OK if vet of dependencies "fails" (reports problems)
 		}
 		if a1.Func == nil {
 			// Built-in packages like unsafe.
@@ -397,7 +422,6 @@
 		}
 		a1.needVet = true
 		a.Func = (*Builder).vet
-
 		return a
 	})
 	return a
@@ -582,7 +606,7 @@
 	p := a.Package
 	if p.UsesCgo() && (cfg.BuildBuildmode == "c-archive" || cfg.BuildBuildmode == "c-shared") {
 		hdrTarget := a.Target[:len(a.Target)-len(filepath.Ext(a.Target))] + ".h"
-		if cfg.BuildContext.Compiler == "gccgo" {
+		if cfg.BuildContext.Compiler == "gccgo" && cfg.BuildO == "" {
 			// For the header file, remove the "lib"
 			// added by go/build, so we generate pkg.h
 			// rather than libpkg.h.
diff --git a/vendor/cmd/go/internal/work/build.go b/vendor/cmd/go/internal/work/build.go
index 908faa1..c6aca11 100644
--- a/vendor/cmd/go/internal/work/build.go
+++ b/vendor/cmd/go/internal/work/build.go
@@ -68,7 +68,7 @@
 		Supported only on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64.
 	-msan
 		enable interoperation with memory sanitizer.
-		Supported only on linux/amd64,
+		Supported only on linux/amd64, linux/arm64
 		and only with Clang/LLVM as the host C compiler.
 	-v
 		print the names of packages as they are compiled.
@@ -305,11 +305,6 @@
 		cfg.BuildO += cfg.ExeSuffix
 	}
 
-	// Special case -o /dev/null by not writing at all.
-	if cfg.BuildO == os.DevNull {
-		cfg.BuildO = ""
-	}
-
 	// sanity check some often mis-used options
 	switch cfg.BuildContext.Compiler {
 	case "gccgo":
@@ -332,6 +327,11 @@
 
 	pkgs = pkgsFilter(load.Packages(args))
 
+	// Special case -o /dev/null by not writing at all.
+	if cfg.BuildO == os.DevNull {
+		cfg.BuildO = ""
+	}
+
 	if cfg.BuildO != "" {
 		if len(pkgs) > 1 {
 			base.Fatalf("go build: cannot use -o with multiple packages")
diff --git a/vendor/cmd/go/internal/work/build_test.go b/vendor/cmd/go/internal/work/build_test.go
index 3f5ba37..010e17e 100644
--- a/vendor/cmd/go/internal/work/build_test.go
+++ b/vendor/cmd/go/internal/work/build_test.go
@@ -42,15 +42,60 @@
 	}{
 		{[]byte(`-r:foo -L/usr/white\ space/lib -lfoo\ bar -lbar\ baz`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}},
 		{[]byte(`-lextra\ fun\ arg\\`), []string{`-lextra fun arg\`}},
-		{[]byte(`broken flag\`), []string{"broken", "flag"}},
 		{[]byte("\textra     whitespace\r\n"), []string{"extra", "whitespace"}},
 		{[]byte("     \r\n      "), nil},
+		{[]byte(`"-r:foo" "-L/usr/white space/lib" "-lfoo bar" "-lbar baz"`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}},
+		{[]byte(`"-lextra fun arg\\"`), []string{`-lextra fun arg\`}},
+		{[]byte(`"     \r\n\      "`), []string{`     \r\n\      `}},
+		{[]byte(`""`), nil},
+		{[]byte(``), nil},
+		{[]byte(`"\\"`), []string{`\`}},
+		{[]byte(`"\x"`), []string{`\x`}},
+		{[]byte(`"\\x"`), []string{`\x`}},
+		{[]byte(`'\\'`), []string{`\`}},
+		{[]byte(`'\x'`), []string{`\x`}},
+		{[]byte(`"\\x"`), []string{`\x`}},
+		{[]byte(`-fPIC -I/test/include/foo -DQUOTED='"/test/share/doc"'`), []string{"-fPIC", "-I/test/include/foo", `-DQUOTED="/test/share/doc"`}},
+		{[]byte(`-fPIC -I/test/include/foo -DQUOTED="/test/share/doc"`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}},
+		{[]byte(`-fPIC -I/test/include/foo -DQUOTED=\"/test/share/doc\"`), []string{"-fPIC", "-I/test/include/foo", `-DQUOTED="/test/share/doc"`}},
+		{[]byte(`-fPIC -I/test/include/foo -DQUOTED='/test/share/doc'`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}},
+		{[]byte(`-DQUOTED='/te\st/share/d\oc'`), []string{`-DQUOTED=/te\st/share/d\oc`}},
+		{[]byte(`-Dhello=10 -Dworld=+32 -DDEFINED_FROM_PKG_CONFIG=hello\ world`), []string{"-Dhello=10", "-Dworld=+32", "-DDEFINED_FROM_PKG_CONFIG=hello world"}},
+		{[]byte(`"broken\"" \\\a "a"`), []string{"broken\"", "\\a", "a"}},
 	} {
-		got := splitPkgConfigOutput(test.in)
+		got, err := splitPkgConfigOutput(test.in)
+		if err != nil {
+			t.Errorf("splitPkgConfigOutput on %v failed with error %v", test.in, err)
+			continue
+		}
 		if !reflect.DeepEqual(got, test.want) {
 			t.Errorf("splitPkgConfigOutput(%v) = %v; want %v", test.in, got, test.want)
 		}
 	}
+
+	for _, test := range []struct {
+		in   []byte
+		want []string
+	}{
+		// broken quotation
+		{[]byte(`"     \r\n      `), nil},
+		{[]byte(`"-r:foo" "-L/usr/white space/lib "-lfoo bar" "-lbar baz"`), nil},
+		{[]byte(`"-lextra fun arg\\`), nil},
+		// broken char escaping
+		{[]byte(`broken flag\`), nil},
+		{[]byte(`extra broken flag \`), nil},
+		{[]byte(`\`), nil},
+		{[]byte(`"broken\"" "extra" \`), nil},
+	} {
+		got, err := splitPkgConfigOutput(test.in)
+		if err == nil {
+			t.Errorf("splitPkgConfigOutput(%v) = %v; haven't failed with error as expected.", test.in, got)
+		}
+		if !reflect.DeepEqual(got, test.want) {
+			t.Errorf("splitPkgConfigOutput(%v) = %v; want %v", test.in, got, test.want)
+		}
+	}
+
 }
 
 func TestSharedLibName(t *testing.T) {
@@ -220,7 +265,7 @@
 	defer pkgfile.Close()
 
 	dirGIDFile := filepath.Join(setgiddir, "setgid")
-	if err := b.moveOrCopyFile(nil, dirGIDFile, pkgfile.Name(), 0666, true); err != nil {
+	if err := b.moveOrCopyFile(dirGIDFile, pkgfile.Name(), 0666, true); err != nil {
 		t.Fatalf("moveOrCopyFile: %v", err)
 	}
 
diff --git a/vendor/cmd/go/internal/work/buildid.go b/vendor/cmd/go/internal/work/buildid.go
index 39ca20e..521b88c 100644
--- a/vendor/cmd/go/internal/work/buildid.go
+++ b/vendor/cmd/go/internal/work/buildid.go
@@ -134,6 +134,8 @@
 	return string(dst[:])
 }
 
+var oldVet = false
+
 // toolID returns the unique ID to use for the current copy of the
 // named tool (asm, compile, cover, link).
 //
@@ -166,6 +168,10 @@
 // build setups agree on details like $GOROOT and file name paths, but at least the
 // tool IDs do not make it impossible.)
 func (b *Builder) toolID(name string) string {
+	if name == "vet" && oldVet {
+		return ""
+	}
+
 	b.id.Lock()
 	id := b.toolIDCache[name]
 	b.id.Unlock()
@@ -174,20 +180,33 @@
 		return id
 	}
 
-	cmdline := str.StringList(cfg.BuildToolexec, base.Tool(name), "-V=full")
+	path := base.Tool(name)
+	desc := "go tool " + name
+
+	// Special case: undocumented -vettool overrides usual vet, for testing vet.
+	if name == "vet" && VetTool != "" {
+		path = VetTool
+		desc = VetTool
+	}
+
+	cmdline := str.StringList(cfg.BuildToolexec, path, "-V=full")
 	cmd := exec.Command(cmdline[0], cmdline[1:]...)
 	cmd.Env = base.EnvForDir(cmd.Dir, os.Environ())
 	var stdout, stderr bytes.Buffer
 	cmd.Stdout = &stdout
 	cmd.Stderr = &stderr
 	if err := cmd.Run(); err != nil {
-		base.Fatalf("go tool %s: %v\n%s%s", name, err, stdout.Bytes(), stderr.Bytes())
+		if name == "vet" {
+			oldVet = true
+			return ""
+		}
+		base.Fatalf("%s: %v\n%s%s", desc, err, stdout.Bytes(), stderr.Bytes())
 	}
 
 	line := stdout.String()
 	f := strings.Fields(line)
-	if len(f) < 3 || f[0] != name || f[1] != "version" || f[2] == "devel" && !strings.HasPrefix(f[len(f)-1], "buildID=") {
-		base.Fatalf("go tool %s -V=full: unexpected output:\n\t%s", name, line)
+	if len(f) < 3 || f[0] != name && path != VetTool || f[1] != "version" || f[2] == "devel" && !strings.HasPrefix(f[len(f)-1], "buildID=") {
+		base.Fatalf("%s -V=full: unexpected output:\n\t%s", desc, line)
 	}
 	if f[2] == "devel" {
 		// On the development branch, use the content ID part of the build ID.
@@ -235,6 +254,8 @@
 	cmdline := str.StringList(cfg.BuildToolexec, name, "-###", "-x", language, "-c", "-")
 	cmd := exec.Command(cmdline[0], cmdline[1:]...)
 	cmd.Env = base.EnvForDir(cmd.Dir, os.Environ())
+	// Force untranslated output so that we see the string "version".
+	cmd.Env = append(cmd.Env, "LC_ALL=C")
 	out, err := cmd.CombinedOutput()
 	if err != nil {
 		return "", fmt.Errorf("%s: %v; output: %q", name, err, out)
@@ -292,13 +313,32 @@
 	return id, nil
 }
 
+// Check if assembler used by gccgo is GNU as.
+func assemblerIsGas() bool {
+	cmd := exec.Command(BuildToolchain.compiler(), "-print-prog-name=as")
+	assembler, err := cmd.Output()
+	if err == nil {
+		cmd := exec.Command(strings.TrimSpace(string(assembler)), "--version")
+		out, err := cmd.Output()
+		return err == nil && strings.Contains(string(out), "GNU")
+	} else {
+		return false
+	}
+}
+
 // gccgoBuildIDELFFile creates an assembler file that records the
 // action's build ID in an SHF_EXCLUDE section.
 func (b *Builder) gccgoBuildIDELFFile(a *Action) (string, error) {
 	sfile := a.Objdir + "_buildid.s"
 
 	var buf bytes.Buffer
-	fmt.Fprintf(&buf, "\t"+`.section .go.buildid,"e"`+"\n")
+	if cfg.Goos != "solaris" || assemblerIsGas() {
+		fmt.Fprintf(&buf, "\t"+`.section .go.buildid,"e"`+"\n")
+	} else if cfg.Goarch == "sparc" || cfg.Goarch == "sparc64" {
+		fmt.Fprintf(&buf, "\t"+`.section ".go.buildid",#exclude`+"\n")
+	} else { // cfg.Goarch == "386" || cfg.Goarch == "amd64"
+		fmt.Fprintf(&buf, "\t"+`.section .go.buildid,#exclude`+"\n")
+	}
 	fmt.Fprintf(&buf, "\t.byte ")
 	for i := 0; i < len(a.buildID); i++ {
 		if i > 0 {
@@ -311,8 +351,10 @@
 		fmt.Fprintf(&buf, "%#02x", a.buildID[i])
 	}
 	fmt.Fprintf(&buf, "\n")
-	fmt.Fprintf(&buf, "\t"+`.section .note.GNU-stack,"",@progbits`+"\n")
-	fmt.Fprintf(&buf, "\t"+`.section .note.GNU-split-stack,"",@progbits`+"\n")
+	if cfg.Goos != "solaris" {
+		fmt.Fprintf(&buf, "\t"+`.section .note.GNU-stack,"",@progbits`+"\n")
+		fmt.Fprintf(&buf, "\t"+`.section .note.GNU-split-stack,"",@progbits`+"\n")
+	}
 
 	if cfg.BuildN || cfg.BuildX {
 		for _, line := range bytes.Split(buf.Bytes(), []byte("\n")) {
@@ -397,15 +439,7 @@
 	// If so, it's up to date and we can reuse it instead of rebuilding it.
 	var buildID string
 	if target != "" && !cfg.BuildA {
-		var err error
-		buildID, err = buildid.ReadFile(target)
-		if err != nil && b.ComputeStaleOnly {
-			if p != nil && !p.Stale {
-				p.Stale = true
-				p.StaleReason = "target missing"
-			}
-			return true
-		}
+		buildID, _ = buildid.ReadFile(target)
 		if strings.HasPrefix(buildID, actionID+buildIDSeparator) {
 			a.buildID = buildID
 			a.built = target
@@ -420,7 +454,7 @@
 	// already up-to-date, then to avoid a rebuild, report the package
 	// as up-to-date as well. See "Build IDs" comment above.
 	// TODO(rsc): Rewrite this code to use a TryCache func on the link action.
-	if target != "" && !cfg.BuildA && a.Mode == "build" && len(a.triggers) == 1 && a.triggers[0].Mode == "link" {
+	if target != "" && !cfg.BuildA && !b.NeedExport && a.Mode == "build" && len(a.triggers) == 1 && a.triggers[0].Mode == "link" {
 		buildID, err := buildid.ReadFile(target)
 		if err == nil {
 			id := strings.Split(buildID, buildIDSeparator)
@@ -461,8 +495,8 @@
 		return true
 	}
 
-	if b.ComputeStaleOnly {
-		// Invoked during go list only to compute and record staleness.
+	if b.IsCmdList {
+		// Invoked during go list to compute and record staleness.
 		if p := a.Package; p != nil && !p.Stale {
 			p.Stale = true
 			if cfg.BuildA {
@@ -482,7 +516,10 @@
 				}
 			}
 		}
-		return true
+
+		// Fall through to update a.buildID from the build artifact cache,
+		// which will affect the computation of buildIDs for targets
+		// higher up in the dependency graph.
 	}
 
 	// Check the build artifact cache.
@@ -491,14 +528,9 @@
 	// but we're still happy to use results from the build artifact cache.
 	if c := cache.Default(); c != nil {
 		if !cfg.BuildA {
-			entry, err := c.Get(actionHash)
-			if err == nil {
-				file := c.OutputFile(entry.OutputID)
-				info, err1 := os.Stat(file)
-				buildID, err2 := buildid.ReadFile(file)
-				if err1 == nil && err2 == nil && info.Size() == entry.Size {
-					stdout, stdoutEntry, err := c.GetBytes(cache.Subkey(a.actionID, "stdout"))
-					if err == nil {
+			if file, _, err := c.GetFile(actionHash); err == nil {
+				if buildID, err := buildid.ReadFile(file); err == nil {
+					if stdout, stdoutEntry, err := c.GetBytes(cache.Subkey(a.actionID, "stdout")); err == nil {
 						if len(stdout) > 0 {
 							if cfg.BuildX || cfg.BuildN {
 								b.Showcmd("", "%s  # internal", joinUnambiguously(str.StringList("cat", c.OutputFile(stdoutEntry.OutputID))))
@@ -510,6 +542,10 @@
 						a.built = file
 						a.Target = "DO NOT USE - using cache"
 						a.buildID = buildID
+						if p := a.Package; p != nil {
+							// Clearer than explaining that something else is stale.
+							p.StaleReason = "not installed but available in build cache"
+						}
 						return true
 					}
 				}
@@ -604,11 +640,17 @@
 				panic("internal error: a.output not set")
 			}
 			outputID, _, err := c.Put(a.actionID, r)
+			r.Close()
 			if err == nil && cfg.BuildX {
 				b.Showcmd("", "%s # internal", joinUnambiguously(str.StringList("cp", target, c.OutputFile(outputID))))
 			}
+			if b.NeedExport {
+				if err != nil {
+					return err
+				}
+				a.Package.Export = c.OutputFile(outputID)
+			}
 			c.PutBytes(cache.Subkey(a.actionID, "stdout"), a.output)
-			r.Close()
 		}
 	}
 
diff --git a/vendor/cmd/go/internal/work/exec.go b/vendor/cmd/go/internal/work/exec.go
index a1d68d2..6b97356 100644
--- a/vendor/cmd/go/internal/work/exec.go
+++ b/vendor/cmd/go/internal/work/exec.go
@@ -14,6 +14,7 @@
 	"io"
 	"io/ioutil"
 	"log"
+	"math/rand"
 	"os"
 	"os/exec"
 	"path/filepath"
@@ -60,7 +61,7 @@
 
 // do runs the action graph rooted at root.
 func (b *Builder) Do(root *Action) {
-	if c := cache.Default(); c != nil && !b.ComputeStaleOnly {
+	if c := cache.Default(); c != nil && !b.IsCmdList {
 		// If we're doing real work, take time at the end to trim the cache.
 		defer c.Trim()
 	}
@@ -299,45 +300,78 @@
 		}
 	}
 
-	fmt.Fprintf(h, "buildinfo %q\n", p.Internal.BuildInfo)
-
 	return h.Sum()
 }
 
+// needCgoHdr reports whether the actions triggered by this one
+// expect to be able to access the cgo-generated header file.
+func (b *Builder) needCgoHdr(a *Action) bool {
+	// If this build triggers a header install, run cgo to get the header.
+	if !b.IsCmdList && (a.Package.UsesCgo() || a.Package.UsesSwig()) && (cfg.BuildBuildmode == "c-archive" || cfg.BuildBuildmode == "c-shared") {
+		for _, t1 := range a.triggers {
+			if t1.Mode == "install header" {
+				return true
+			}
+		}
+		for _, t1 := range a.triggers {
+			for _, t2 := range t1.triggers {
+				if t2.Mode == "install header" {
+					return true
+				}
+			}
+		}
+	}
+	return false
+}
+
+const (
+	needBuild uint32 = 1 << iota
+	needCgoHdr
+	needVet
+	needCgoFiles
+	needStale
+)
+
 // build is the action for building a single package.
 // Note that any new influence on this logic must be reported in b.buildActionID above as well.
 func (b *Builder) build(a *Action) (err error) {
 	p := a.Package
+
+	bit := func(x uint32, b bool) uint32 {
+		if b {
+			return x
+		}
+		return 0
+	}
+
 	cached := false
+	need := bit(needBuild, !b.IsCmdList || b.NeedExport) |
+		bit(needCgoHdr, b.needCgoHdr(a)) |
+		bit(needVet, a.needVet) |
+		bit(needCgoFiles, b.NeedCgoFiles && (p.UsesCgo() || p.UsesSwig()))
+
+	// Save p.CgoFiles now, because we may modify it for go list.
+	cgofiles := append([]string{}, p.CgoFiles...)
+
 	if !p.BinaryOnly {
 		if b.useCache(a, p, b.buildActionID(a), p.Target) {
-			// If this build triggers a header install, run cgo to get the header.
-			// TODO(rsc): Once we can cache multiple file outputs from an action,
-			// the header should be cached, and then this awful test can be deleted.
-			// Need to look for install header actions depending on this action,
-			// or depending on a link that depends on this action.
-			needHeader := false
-			if (a.Package.UsesCgo() || a.Package.UsesSwig()) && (cfg.BuildBuildmode == "c-archive" || cfg.BuildBuildmode == "c-shared") {
-				for _, t1 := range a.triggers {
-					if t1.Mode == "install header" {
-						needHeader = true
-						goto CheckedHeader
-					}
-				}
-				for _, t1 := range a.triggers {
-					for _, t2 := range t1.triggers {
-						if t2.Mode == "install header" {
-							needHeader = true
-							goto CheckedHeader
-						}
-					}
-				}
+			// We found the main output in the cache.
+			// If we don't need any other outputs, we can stop.
+			need &^= needBuild
+			if b.NeedExport {
+				p.Export = a.built
 			}
-		CheckedHeader:
-			if b.ComputeStaleOnly || !a.needVet && !needHeader {
-				return nil
+			if need&needCgoFiles != 0 && b.loadCachedCgoFiles(a) {
+				need &^= needCgoFiles
 			}
+			// Otherwise, we need to write files to a.Objdir (needVet, needCgoHdr).
+			// Remember that we might have them in cache
+			// and check again after we create a.Objdir.
 			cached = true
+			a.output = []byte{} // start saving output in case we miss any cache results
+		}
+		if need == 0 {
+			return nil
 		}
 		defer b.flushOutput(a)
 	}
@@ -346,6 +380,9 @@
 		if err != nil && err != errPrintedOutput {
 			err = fmt.Errorf("go build %s: %v", a.Package.ImportPath, err)
 		}
+		if err != nil && b.IsCmdList && b.NeedError && p.Error == nil {
+			p.Error = &load.PackageError{Err: err.Error()}
+		}
 	}()
 	if cfg.BuildN {
 		// In -n mode, print a banner between packages.
@@ -365,14 +402,17 @@
 		if err == nil {
 			a.built = a.Package.Target
 			a.Target = a.Package.Target
+			if b.NeedExport {
+				a.Package.Export = a.Package.Target
+			}
 			a.buildID = b.fileHash(a.Package.Target)
 			a.Package.Stale = false
 			a.Package.StaleReason = "binary-only package"
 			return nil
 		}
-		if b.ComputeStaleOnly {
-			a.Package.Stale = true
-			a.Package.StaleReason = "missing or invalid binary-only package"
+		a.Package.Stale = true
+		a.Package.StaleReason = "missing or invalid binary-only package"
+		if b.IsCmdList {
 			return nil
 		}
 		return fmt.Errorf("missing or invalid binary-only package")
@@ -383,6 +423,23 @@
 	}
 	objdir := a.Objdir
 
+	if cached {
+		if need&needCgoHdr != 0 && b.loadCachedCgoHdr(a) {
+			need &^= needCgoHdr
+		}
+
+		// Load cached vet config, but only if that's all we have left
+		// (need == needVet, not testing just the one bit).
+		// If we are going to do a full build anyway,
+		// we're going to regenerate the files below anyway.
+		if need == needVet && b.loadCachedVet(a) {
+			need &^= needVet
+		}
+		if need == 0 {
+			return nil
+		}
+	}
+
 	// make target directory
 	dir, _ := filepath.Split(a.Target)
 	if dir != "" {
@@ -391,10 +448,8 @@
 		}
 	}
 
-	var gofiles, cgofiles, cfiles, sfiles, cxxfiles, objects, cgoObjects, pcCFLAGS, pcLDFLAGS []string
-
+	var gofiles, cfiles, sfiles, cxxfiles, objects, cgoObjects, pcCFLAGS, pcLDFLAGS []string
 	gofiles = append(gofiles, a.Package.GoFiles...)
-	cgofiles = append(cgofiles, a.Package.CgoFiles...)
 	cfiles = append(cfiles, a.Package.CFiles...)
 	sfiles = append(sfiles, a.Package.SFiles...)
 	cxxfiles = append(cxxfiles, a.Package.CXXFiles...)
@@ -441,7 +496,7 @@
 				// Not covering this file.
 				continue
 			}
-			if err := b.cover(a, coverFile, sourceFile, 0666, cover.Var); err != nil {
+			if err := b.cover(a, coverFile, sourceFile, cover.Var); err != nil {
 				return err
 			}
 			if i < len(gofiles) {
@@ -497,10 +552,16 @@
 		}
 		cgoObjects = append(cgoObjects, outObj...)
 		gofiles = append(gofiles, outGo...)
+
+		switch cfg.BuildBuildmode {
+		case "c-archive", "c-shared":
+			b.cacheCgoHdr(a)
+		}
 	}
-	if cached && !a.needVet {
-		return nil
-	}
+	b.cacheGofiles(a, gofiles)
+
+	// Running cgo generated the cgo header.
+	need &^= needCgoHdr
 
 	// Sanity check only, since Package.load already checked as well.
 	if len(gofiles) == 0 {
@@ -508,25 +569,19 @@
 	}
 
 	// Prepare Go vet config if needed.
-	var vcfg *vetConfig
-	if a.needVet {
-		// Pass list of absolute paths to vet,
-		// so that vet's error messages will use absolute paths,
-		// so that we can reformat them relative to the directory
-		// in which the go command is invoked.
-		vcfg = &vetConfig{
-			Compiler:    cfg.BuildToolchainName,
-			Dir:         a.Package.Dir,
-			GoFiles:     mkAbsFiles(a.Package.Dir, gofiles),
-			ImportPath:  a.Package.ImportPath,
-			ImportMap:   make(map[string]string),
-			PackageFile: make(map[string]string),
+	if need&needVet != 0 {
+		buildVetConfig(a, gofiles)
+		need &^= needVet
+	}
+	if need&needCgoFiles != 0 {
+		if !b.loadCachedCgoFiles(a) {
+			return fmt.Errorf("failed to cache translated CgoFiles")
 		}
-		a.vetCfg = vcfg
-		for i, raw := range a.Package.Internal.RawImports {
-			final := a.Package.Imports[i]
-			vcfg.ImportMap[raw] = final
-		}
+		need &^= needCgoFiles
+	}
+	if need == 0 {
+		// Nothing left to do.
+		return nil
 	}
 
 	// Prepare Go import config.
@@ -537,48 +592,20 @@
 	// except when it doesn't.
 	var icfg bytes.Buffer
 	fmt.Fprintf(&icfg, "# import config\n")
-
 	for i, raw := range a.Package.Internal.RawImports {
 		final := a.Package.Imports[i]
 		if final != raw {
 			fmt.Fprintf(&icfg, "importmap %s=%s\n", raw, final)
 		}
 	}
-
-	// Compute the list of mapped imports in the vet config
-	// so that we can add any missing mappings below.
-	var vcfgMapped map[string]bool
-	if vcfg != nil {
-		vcfgMapped = make(map[string]bool)
-		for _, p := range vcfg.ImportMap {
-			vcfgMapped[p] = true
-		}
-	}
-
 	for _, a1 := range a.Deps {
 		p1 := a1.Package
 		if p1 == nil || p1.ImportPath == "" || a1.built == "" {
 			continue
 		}
 		fmt.Fprintf(&icfg, "packagefile %s=%s\n", p1.ImportPath, a1.built)
-		if vcfg != nil {
-			// Add import mapping if needed
-			// (for imports like "runtime/cgo" that appear only in generated code).
-			if !vcfgMapped[p1.ImportPath] {
-				vcfg.ImportMap[p1.ImportPath] = p1.ImportPath
-			}
-			vcfg.PackageFile[p1.ImportPath] = a1.built
-		}
 	}
 
-	if cached {
-		// The cached package file is OK, so we don't need to run the compile.
-		// We've only going through the motions to prepare the vet configuration,
-		// which is now complete.
-		return nil
-	}
-
-	// TODO(vgo): If have module info, write file to objdir, add to gofiles.
 	if p.Internal.BuildInfo != "" {
 		if err := b.writeFile(objdir+"_gomod_.go", vgo.ModInfoProg(p.Internal.BuildInfo)); err != nil {
 			return err
@@ -590,7 +617,7 @@
 	objpkg := objdir + "_pkg_.a"
 	ofile, out, err := BuildToolchain.gc(b, a, objpkg, icfg.Bytes(), len(sfiles) > 0, gofiles)
 	if len(out) > 0 {
-		b.showOutput(a, a.Package.Dir, a.Package.ImportPath, b.processOutput(out))
+		b.showOutput(a, a.Package.Dir, a.Package.Desc(), b.processOutput(out))
 		if err != nil {
 			return errPrintedOutput
 		}
@@ -613,17 +640,17 @@
 		switch {
 		case strings.HasSuffix(name, _goos_goarch):
 			targ := file[:len(name)-len(_goos_goarch)] + "_GOOS_GOARCH." + ext
-			if err := b.copyFile(a, objdir+targ, filepath.Join(a.Package.Dir, file), 0666, true); err != nil {
+			if err := b.copyFile(objdir+targ, filepath.Join(a.Package.Dir, file), 0666, true); err != nil {
 				return err
 			}
 		case strings.HasSuffix(name, _goarch):
 			targ := file[:len(name)-len(_goarch)] + "_GOARCH." + ext
-			if err := b.copyFile(a, objdir+targ, filepath.Join(a.Package.Dir, file), 0666, true); err != nil {
+			if err := b.copyFile(objdir+targ, filepath.Join(a.Package.Dir, file), 0666, true); err != nil {
 				return err
 			}
 		case strings.HasSuffix(name, _goos):
 			targ := file[:len(name)-len(_goos)] + "_GOOS." + ext
-			if err := b.copyFile(a, objdir+targ, filepath.Join(a.Package.Dir, file), 0666, true); err != nil {
+			if err := b.copyFile(objdir+targ, filepath.Join(a.Package.Dir, file), 0666, true); err != nil {
 				return err
 			}
 		}
@@ -647,7 +674,7 @@
 	}
 
 	// For gccgo on ELF systems, we write the build ID as an assembler file.
-	// This lets us set the the SHF_EXCLUDE flag.
+	// This lets us set the SHF_EXCLUDE flag.
 	// This is read by readGccgoArchive in cmd/internal/buildid/buildid.go.
 	if a.buildID != "" && cfg.BuildToolchainName == "gccgo" {
 		switch cfg.Goos {
@@ -694,15 +721,188 @@
 	return nil
 }
 
-type vetConfig struct {
-	Compiler    string
-	Dir         string
-	GoFiles     []string
-	ImportMap   map[string]string
-	PackageFile map[string]string
-	ImportPath  string
+func (b *Builder) cacheObjdirFile(a *Action, c *cache.Cache, name string) error {
+	f, err := os.Open(a.Objdir + name)
+	if err != nil {
+		return err
+	}
+	defer f.Close()
+	_, _, err = c.Put(cache.Subkey(a.actionID, name), f)
+	return err
+}
 
-	SucceedOnTypecheckFailure bool
+func (b *Builder) findCachedObjdirFile(a *Action, c *cache.Cache, name string) (string, error) {
+	file, _, err := c.GetFile(cache.Subkey(a.actionID, name))
+	if err != nil {
+		return "", err
+	}
+	return file, nil
+}
+
+func (b *Builder) loadCachedObjdirFile(a *Action, c *cache.Cache, name string) error {
+	cached, err := b.findCachedObjdirFile(a, c, name)
+	if err != nil {
+		return err
+	}
+	return b.copyFile(a.Objdir+name, cached, 0666, true)
+}
+
+func (b *Builder) cacheCgoHdr(a *Action) {
+	c := cache.Default()
+	if c == nil {
+		return
+	}
+	b.cacheObjdirFile(a, c, "_cgo_install.h")
+}
+
+func (b *Builder) loadCachedCgoHdr(a *Action) bool {
+	c := cache.Default()
+	if c == nil {
+		return false
+	}
+	err := b.loadCachedObjdirFile(a, c, "_cgo_install.h")
+	return err == nil
+}
+
+func (b *Builder) cacheGofiles(a *Action, gofiles []string) {
+	c := cache.Default()
+	if c == nil {
+		return
+	}
+	var buf bytes.Buffer
+	for _, file := range gofiles {
+		if !strings.HasPrefix(file, a.Objdir) {
+			// not generated
+			buf.WriteString("./")
+			buf.WriteString(file)
+			buf.WriteString("\n")
+			continue
+		}
+		name := file[len(a.Objdir):]
+		buf.WriteString(name)
+		buf.WriteString("\n")
+		if err := b.cacheObjdirFile(a, c, name); err != nil {
+			return
+		}
+	}
+	c.PutBytes(cache.Subkey(a.actionID, "gofiles"), buf.Bytes())
+}
+
+func (b *Builder) loadCachedVet(a *Action) bool {
+	c := cache.Default()
+	if c == nil {
+		return false
+	}
+	list, _, err := c.GetBytes(cache.Subkey(a.actionID, "gofiles"))
+	if err != nil {
+		return false
+	}
+	var gofiles []string
+	for _, name := range strings.Split(string(list), "\n") {
+		if name == "" { // end of list
+			continue
+		}
+		if strings.HasPrefix(name, "./") {
+			gofiles = append(gofiles, name[2:])
+			continue
+		}
+		if err := b.loadCachedObjdirFile(a, c, name); err != nil {
+			return false
+		}
+		gofiles = append(gofiles, a.Objdir+name)
+	}
+	buildVetConfig(a, gofiles)
+	return true
+}
+
+func (b *Builder) loadCachedCgoFiles(a *Action) bool {
+	c := cache.Default()
+	if c == nil {
+		return false
+	}
+	list, _, err := c.GetBytes(cache.Subkey(a.actionID, "gofiles"))
+	if err != nil {
+		return false
+	}
+	var files []string
+	for _, name := range strings.Split(string(list), "\n") {
+		if name == "" { // end of list
+			continue
+		}
+		if strings.HasPrefix(name, "./") {
+			continue
+		}
+		file, err := b.findCachedObjdirFile(a, c, name)
+		if err != nil {
+			return false
+		}
+		files = append(files, file)
+	}
+	a.Package.CgoFiles = files
+	return true
+}
+
+// vetConfig is the configuration passed to vet describing a single package.
+type vetConfig struct {
+	Compiler   string   // compiler name (gc, gccgo)
+	Dir        string   // directory containing package
+	ImportPath string   // canonical import path ("package path")
+	GoFiles    []string // absolute paths to package source files
+
+	ImportMap   map[string]string // map import path in source code to package path
+	PackageFile map[string]string // map package path to .a file with export data
+	Standard    map[string]bool   // map package path to whether it's in the standard library
+	PackageVetx map[string]string // map package path to vetx data from earlier vet run
+	VetxOnly    bool              // only compute vetx data; don't report detected problems
+	VetxOutput  string            // write vetx data to this output file
+
+	SucceedOnTypecheckFailure bool // awful hack; see #18395 and below
+}
+
+func buildVetConfig(a *Action, gofiles []string) {
+	// Pass list of absolute paths to vet,
+	// so that vet's error messages will use absolute paths,
+	// so that we can reformat them relative to the directory
+	// in which the go command is invoked.
+	vcfg := &vetConfig{
+		Compiler:    cfg.BuildToolchainName,
+		Dir:         a.Package.Dir,
+		GoFiles:     mkAbsFiles(a.Package.Dir, gofiles),
+		ImportPath:  a.Package.ImportPath,
+		ImportMap:   make(map[string]string),
+		PackageFile: make(map[string]string),
+		Standard:    make(map[string]bool),
+	}
+	a.vetCfg = vcfg
+	for i, raw := range a.Package.Internal.RawImports {
+		final := a.Package.Imports[i]
+		vcfg.ImportMap[raw] = final
+	}
+
+	// Compute the list of mapped imports in the vet config
+	// so that we can add any missing mappings below.
+	vcfgMapped := make(map[string]bool)
+	for _, p := range vcfg.ImportMap {
+		vcfgMapped[p] = true
+	}
+
+	for _, a1 := range a.Deps {
+		p1 := a1.Package
+		if p1 == nil || p1.ImportPath == "" {
+			continue
+		}
+		// Add import mapping if needed
+		// (for imports like "runtime/cgo" that appear only in generated code).
+		if !vcfgMapped[p1.ImportPath] {
+			vcfg.ImportMap[p1.ImportPath] = p1.ImportPath
+		}
+		if a1.built != "" {
+			vcfg.PackageFile[p1.ImportPath] = a1.built
+		}
+		if p1.Standard {
+			vcfg.Standard[p1.ImportPath] = true
+		}
+	}
 }
 
 // VetTool is the path to an alternate vet tool binary.
@@ -714,9 +914,16 @@
 var VetFlags []string
 
 func (b *Builder) vet(a *Action) error {
+	b.toolID("vet")
+	if oldVet {
+		return nil
+	}
+
 	// a.Deps[0] is the build of the package being vetted.
 	// a.Deps[1] is the build of the "fmt" package.
 
+	a.Failed = false // vet of dependency may have failed but we can still succeed
+
 	vcfg := a.Deps[0].vetCfg
 	if vcfg == nil {
 		// Vet config should only be missing if the build failed.
@@ -726,10 +933,45 @@
 		return nil
 	}
 
+	vcfg.VetxOnly = a.VetxOnly
+	vcfg.VetxOutput = a.Objdir + "vet.out"
+	vcfg.PackageVetx = make(map[string]string)
+
+	h := cache.NewHash("vet " + a.Package.ImportPath)
+	fmt.Fprintf(h, "vet %q\n", b.toolID("vet"))
+
+	// Note: We could decide that vet should compute export data for
+	// all analyses, in which case we don't need to include the flags here.
+	// But that would mean that if an analysis causes problems like
+	// unexpected crashes there would be no way to turn it off.
+	// It seems better to let the flags disable export analysis too.
+	fmt.Fprintf(h, "vetflags %q\n", VetFlags)
+
+	fmt.Fprintf(h, "pkg %q\n", a.Deps[0].actionID)
+	for _, a1 := range a.Deps {
+		if a1.Mode == "vet" && a1.built != "" {
+			fmt.Fprintf(h, "vetout %q %s\n", a1.Package.ImportPath, b.fileHash(a1.built))
+			vcfg.PackageVetx[a1.Package.ImportPath] = a1.built
+		}
+	}
+	key := cache.ActionID(h.Sum())
+
+	if vcfg.VetxOnly {
+		if c := cache.Default(); c != nil && !cfg.BuildA {
+			if file, _, err := c.GetFile(key); err == nil {
+				a.built = file
+				return nil
+			}
+		}
+	}
+
 	if vcfg.ImportMap["fmt"] == "" {
 		a1 := a.Deps[1]
 		vcfg.ImportMap["fmt"] = "fmt"
-		vcfg.PackageFile["fmt"] = a1.built
+		if a1.built != "" {
+			vcfg.PackageFile["fmt"] = a1.built
+		}
+		vcfg.Standard["fmt"] = true
 	}
 
 	// During go test, ignore type-checking failures during vet.
@@ -737,6 +979,8 @@
 	// so at least for now assume the bug is in vet.
 	// We know of at least #18395.
 	// TODO(rsc,gri): Try to remove this for Go 1.11.
+	//
+	// Disabled 2018-04-20. Let's see if we can do without it.
 	vcfg.SucceedOnTypecheckFailure = cfg.CmdName == "test"
 
 	js, err := json.MarshalIndent(vcfg, "", "\t")
@@ -758,7 +1002,18 @@
 	if tool == "" {
 		tool = base.Tool("vet")
 	}
-	return b.run(a, p.Dir, p.ImportPath, env, cfg.BuildToolexec, tool, VetFlags, a.Objdir+"vet.cfg")
+	runErr := b.run(a, p.Dir, p.ImportPath, env, cfg.BuildToolexec, tool, VetFlags, a.Objdir+"vet.cfg")
+
+	// If vet wrote export data, save it for input to future vets.
+	if f, err := os.Open(vcfg.VetxOutput); err == nil {
+		a.built = vcfg.VetxOutput
+		if c := cache.Default(); c != nil {
+			c.Put(key, f)
+		}
+		f.Close()
+	}
+
+	return runErr
 }
 
 // linkActionID computes the action ID for a link action.
@@ -844,7 +1099,7 @@
 // link is the action for linking a single command.
 // Note that any new influence on this logic must be reported in b.linkActionID above as well.
 func (b *Builder) link(a *Action) (err error) {
-	if b.useCache(a, a.Package, b.linkActionID(a), a.Package.Target) {
+	if b.useCache(a, a.Package, b.linkActionID(a), a.Package.Target) || b.IsCmdList {
 		return nil
 	}
 	defer b.flushOutput(a)
@@ -917,45 +1172,81 @@
 }
 
 // splitPkgConfigOutput parses the pkg-config output into a slice of
-// flags. pkg-config always uses \ to escape special characters.
-func splitPkgConfigOutput(out []byte) []string {
+// flags. This implements the algorithm from pkgconf/libpkgconf/argvsplit.c.
+func splitPkgConfigOutput(out []byte) ([]string, error) {
 	if len(out) == 0 {
-		return nil
+		return nil, nil
 	}
 	var flags []string
-	flag := make([]byte, len(out))
-	r, w := 0, 0
-	for r < len(out) {
-		switch out[r] {
-		case ' ', '\t', '\r', '\n':
-			if w > 0 {
-				flags = append(flags, string(flag[:w]))
+	flag := make([]byte, 0, len(out))
+	escaped := false
+	quote := byte(0)
+
+	for _, c := range out {
+		if escaped {
+			if quote != 0 {
+				switch c {
+				case '$', '`', '"', '\\':
+				default:
+					flag = append(flag, '\\')
+				}
+				flag = append(flag, c)
+			} else {
+				flag = append(flag, c)
 			}
-			w = 0
-		case '\\':
-			r++
-			fallthrough
-		default:
-			if r < len(out) {
-				flag[w] = out[r]
-				w++
+			escaped = false
+		} else if quote != 0 {
+			if c == quote {
+				quote = 0
+			} else {
+				switch c {
+				case '\\':
+					escaped = true
+				default:
+					flag = append(flag, c)
+				}
 			}
+		} else if strings.IndexByte(" \t\n\v\f\r", c) < 0 {
+			switch c {
+			case '\\':
+				escaped = true
+			case '\'', '"':
+				quote = c
+			default:
+				flag = append(flag, c)
+			}
+		} else if len(flag) != 0 {
+			flags = append(flags, string(flag))
+			flag = flag[:0]
 		}
-		r++
 	}
-	if w > 0 {
-		flags = append(flags, string(flag[:w]))
+	if escaped {
+		return nil, errors.New("broken character escaping in pkgconf output ")
 	}
-	return flags
+	if quote != 0 {
+		return nil, errors.New("unterminated quoted string in pkgconf output ")
+	} else if len(flag) != 0 {
+		flags = append(flags, string(flag))
+	}
+
+	return flags, nil
 }
 
 // Calls pkg-config if needed and returns the cflags/ldflags needed to build the package.
 func (b *Builder) getPkgConfigFlags(p *load.Package) (cflags, ldflags []string, err error) {
-	if pkgs := p.CgoPkgConfig; len(pkgs) > 0 {
+	if pcargs := p.CgoPkgConfig; len(pcargs) > 0 {
+		// pkg-config permits arguments to appear anywhere in
+		// the command line. Move them all to the front, before --.
 		var pcflags []string
-		for len(pkgs) > 0 && strings.HasPrefix(pkgs[0], "--") {
-			pcflags = append(pcflags, pkgs[0])
-			pkgs = pkgs[1:]
+		var pkgs []string
+		for _, pcarg := range pcargs {
+			if pcarg == "--" {
+				// We're going to add our own "--" argument.
+			} else if strings.HasPrefix(pcarg, "--") {
+				pcflags = append(pcflags, pcarg)
+			} else {
+				pkgs = append(pkgs, pcarg)
+			}
 		}
 		for _, pkg := range pkgs {
 			if !load.SafeArg(pkg) {
@@ -963,21 +1254,24 @@
 			}
 		}
 		var out []byte
-		out, err = b.runOut(p.Dir, p.ImportPath, nil, b.PkgconfigCmd(), "--cflags", pcflags, "--", pkgs)
+		out, err = b.runOut(p.Dir, nil, b.PkgconfigCmd(), "--cflags", pcflags, "--", pkgs)
 		if err != nil {
-			b.showOutput(nil, p.Dir, b.PkgconfigCmd()+" --cflags "+strings.Join(pcflags, " ")+strings.Join(pkgs, " "), string(out))
+			b.showOutput(nil, p.Dir, b.PkgconfigCmd()+" --cflags "+strings.Join(pcflags, " ")+" -- "+strings.Join(pkgs, " "), string(out))
 			b.Print(err.Error() + "\n")
 			return nil, nil, errPrintedOutput
 		}
 		if len(out) > 0 {
-			cflags = splitPkgConfigOutput(out)
+			cflags, err = splitPkgConfigOutput(out)
+			if err != nil {
+				return nil, nil, err
+			}
 			if err := checkCompilerFlags("CFLAGS", "pkg-config --cflags", cflags); err != nil {
 				return nil, nil, err
 			}
 		}
-		out, err = b.runOut(p.Dir, p.ImportPath, nil, b.PkgconfigCmd(), "--libs", pcflags, "--", pkgs)
+		out, err = b.runOut(p.Dir, nil, b.PkgconfigCmd(), "--libs", pcflags, "--", pkgs)
 		if err != nil {
-			b.showOutput(nil, p.Dir, b.PkgconfigCmd()+" --libs "+strings.Join(pcflags, " ")+strings.Join(pkgs, " "), string(out))
+			b.showOutput(nil, p.Dir, b.PkgconfigCmd()+" --libs "+strings.Join(pcflags, " ")+" -- "+strings.Join(pkgs, " "), string(out))
 			b.Print(err.Error() + "\n")
 			return nil, nil, errPrintedOutput
 		}
@@ -1038,7 +1332,7 @@
 }
 
 func (b *Builder) linkShared(a *Action) (err error) {
-	if b.useCache(a, nil, b.linkSharedActionID(a), a.Target) {
+	if b.useCache(a, nil, b.linkSharedActionID(a), a.Target) || b.IsCmdList {
 		return nil
 	}
 	defer b.flushOutput(a)
@@ -1102,13 +1396,17 @@
 		// We want to hide that awful detail as much as possible, so don't
 		// advertise it by touching the mtimes (usually the libraries are up
 		// to date).
-		if !a.buggyInstall {
+		if !a.buggyInstall && !b.IsCmdList {
 			now := time.Now()
 			os.Chtimes(a.Target, now, now)
 		}
 		return nil
 	}
-	if b.ComputeStaleOnly {
+
+	// If we're building for go list -export,
+	// never install anything; just keep the cache reference.
+	if b.IsCmdList {
+		a.built = a1.built
 		return nil
 	}
 
@@ -1135,7 +1433,7 @@
 
 	defer b.cleanup(a1)
 
-	return b.moveOrCopyFile(a, a.Target, a1.built, perm, false)
+	return b.moveOrCopyFile(a.Target, a1.built, perm, false)
 }
 
 // cleanup removes a's object dir to keep the amount of
@@ -1145,14 +1443,18 @@
 func (b *Builder) cleanup(a *Action) {
 	if !cfg.BuildWork {
 		if cfg.BuildX {
-			b.Showcmd("", "rm -r %s", a.Objdir)
+			// Don't say we are removing the directory if
+			// we never created it.
+			if _, err := os.Stat(a.Objdir); err == nil || cfg.BuildN {
+				b.Showcmd("", "rm -r %s", a.Objdir)
+			}
 		}
 		os.RemoveAll(a.Objdir)
 	}
 }
 
 // moveOrCopyFile is like 'mv src dst' or 'cp src dst'.
-func (b *Builder) moveOrCopyFile(a *Action, dst, src string, perm os.FileMode, force bool) error {
+func (b *Builder) moveOrCopyFile(dst, src string, perm os.FileMode, force bool) error {
 	if cfg.BuildN {
 		b.Showcmd("", "mv %s %s", src, dst)
 		return nil
@@ -1163,7 +1465,7 @@
 
 	// If the source is in the build cache, we need to copy it.
 	if strings.HasPrefix(src, cache.DefaultDir()) {
-		return b.copyFile(a, dst, src, perm, force)
+		return b.copyFile(dst, src, perm, force)
 	}
 
 	// On Windows, always copy the file, so that we respect the NTFS
@@ -1171,7 +1473,7 @@
 	// What matters here is not cfg.Goos (the system we are building
 	// for) but runtime.GOOS (the system we are building on).
 	if runtime.GOOS == "windows" {
-		return b.copyFile(a, dst, src, perm, force)
+		return b.copyFile(dst, src, perm, force)
 	}
 
 	// If the destination directory has the group sticky bit set,
@@ -1179,7 +1481,7 @@
 	// https://golang.org/issue/18878
 	if fi, err := os.Stat(filepath.Dir(dst)); err == nil {
 		if fi.IsDir() && (fi.Mode()&os.ModeSetgid) != 0 {
-			return b.copyFile(a, dst, src, perm, force)
+			return b.copyFile(dst, src, perm, force)
 		}
 	}
 
@@ -1209,11 +1511,11 @@
 		}
 	}
 
-	return b.copyFile(a, dst, src, perm, force)
+	return b.copyFile(dst, src, perm, force)
 }
 
 // copyFile is like 'cp src dst'.
-func (b *Builder) copyFile(a *Action, dst, src string, perm os.FileMode, force bool) error {
+func (b *Builder) copyFile(dst, src string, perm os.FileMode, force bool) error {
 	if cfg.BuildN || cfg.BuildX {
 		b.Showcmd("", "cp %s %s", src, dst)
 		if cfg.BuildN {
@@ -1304,12 +1606,12 @@
 		}
 	}
 
-	return b.moveOrCopyFile(a, a.Target, src, 0666, true)
+	return b.moveOrCopyFile(a.Target, src, 0666, true)
 }
 
 // cover runs, in effect,
 //	go tool cover -mode=b.coverMode -var="varName" -o dst.go src.go
-func (b *Builder) cover(a *Action, dst, src string, perm os.FileMode, varName string) error {
+func (b *Builder) cover(a *Action, dst, src string, varName string) error {
 	return b.run(a, a.Objdir, "cover "+a.Package.ImportPath, nil,
 		cfg.BuildToolexec,
 		base.Tool("cover"),
@@ -1330,6 +1632,7 @@
 	{0x00, 0x00, 0x01, 0xEB},                  // Plan 9 i386
 	{0x00, 0x00, 0x8a, 0x97},                  // Plan 9 amd64
 	{0x00, 0x00, 0x06, 0x47},                  // Plan 9 arm
+	{0x00, 0x61, 0x73, 0x6D},                  // WASM
 }
 
 func isObject(s string) bool {
@@ -1373,7 +1676,11 @@
 func (b *Builder) fmtcmd(dir string, format string, args ...interface{}) string {
 	cmd := fmt.Sprintf(format, args...)
 	if dir != "" && dir != "/" {
-		cmd = strings.Replace(" "+cmd, " "+dir, " .", -1)[1:]
+		dot := " ."
+		if dir[len(dir)-1] == filepath.Separator {
+			dot += string(filepath.Separator)
+		}
+		cmd = strings.Replace(" "+cmd, " "+dir, dot, -1)[1:]
 		if b.scriptDir != dir {
 			b.scriptDir = dir
 			cmd = "cd " + dir + "\n" + cmd
@@ -1452,7 +1759,7 @@
 // If the command fails, run prints information about the failure
 // and returns a non-nil error.
 func (b *Builder) run(a *Action, dir string, desc string, env []string, cmdargs ...interface{}) error {
-	out, err := b.runOut(dir, desc, env, cmdargs...)
+	out, err := b.runOut(dir, env, cmdargs...)
 	if len(out) > 0 {
 		if desc == "" {
 			desc = b.fmtcmd(dir, "%s", strings.Join(str.StringList(cmdargs...), " "))
@@ -1484,7 +1791,7 @@
 
 // runOut runs the command given by cmdline in the directory dir.
 // It returns the command output and any errors that occurred.
-func (b *Builder) runOut(dir string, desc string, env []string, cmdargs ...interface{}) ([]byte, error) {
+func (b *Builder) runOut(dir string, env []string, cmdargs ...interface{}) ([]byte, error) {
 	cmdline := str.StringList(cmdargs...)
 
 	for _, arg := range cmdline {
@@ -1520,6 +1827,8 @@
 	cmd := exec.Command(cmdline[0], cmdline[1:]...)
 	cmd.Stdout = &buf
 	cmd.Stderr = &buf
+	cleanup := passLongArgsInResponseFiles(cmd)
+	defer cleanup()
 	cmd.Dir = dir
 	cmd.Env = base.MergeEnvLists(env, base.EnvForDir(cmd.Dir, os.Environ()))
 	err := cmd.Run()
@@ -1545,7 +1854,9 @@
 			buf.WriteByte(' ')
 		}
 		q := strconv.Quote(s)
-		if s == "" || strings.Contains(s, " ") || len(q) > len(s)+2 {
+		// A gccgo command line can contain -( and -).
+		// Make sure we quote them since they are special to the shell.
+		if s == "" || strings.ContainsAny(s, " ()") || len(q) > len(s)+2 {
 			buf.WriteString(q)
 		} else {
 			buf.WriteString(s)
@@ -1585,6 +1896,11 @@
 
 // symlink creates a symlink newname -> oldname.
 func (b *Builder) Symlink(oldname, newname string) error {
+	// It's not an error to try to recreate an existing symlink.
+	if link, err := os.Readlink(newname); err == nil && link == oldname {
+		return nil
+	}
+
 	if cfg.BuildN || cfg.BuildX {
 		b.Showcmd("", "ln -s %s %s", oldname, newname)
 		if cfg.BuildN {
@@ -1696,7 +2012,7 @@
 	if !filepath.IsAbs(outfile) {
 		outfile = filepath.Join(p.Dir, outfile)
 	}
-	output, err := b.runOut(filepath.Dir(file), desc, nil, compiler, flags, "-o", outfile, "-c", filepath.Base(file))
+	output, err := b.runOut(filepath.Dir(file), nil, compiler, flags, "-o", outfile, "-c", filepath.Base(file))
 	if len(output) > 0 {
 		// On FreeBSD 11, when we pass -g to clang 3.8 it
 		// invokes its internal assembler with -dwarf-version=2.
@@ -2220,7 +2536,7 @@
 )
 
 func (b *Builder) swigDoVersionCheck() error {
-	out, err := b.runOut("", "", nil, "swig", "-version")
+	out, err := b.runOut("", nil, "swig", "-version")
 	if err != nil {
 		return err
 	}
@@ -2375,19 +2691,19 @@
 		args = append(args, "-c++")
 	}
 
-	out, err := b.runOut(p.Dir, p.ImportPath, nil, "swig", args, file)
+	out, err := b.runOut(p.Dir, nil, "swig", args, file)
 	if err != nil {
 		if len(out) > 0 {
 			if bytes.Contains(out, []byte("-intgosize")) || bytes.Contains(out, []byte("-cgo")) {
 				return "", "", errors.New("must have SWIG version >= 3.0.6")
 			}
-			b.showOutput(a, p.Dir, p.ImportPath, b.processOutput(out)) // swig error
+			b.showOutput(a, p.Dir, p.Desc(), b.processOutput(out)) // swig error
 			return "", "", errPrintedOutput
 		}
 		return "", "", err
 	}
 	if len(out) > 0 {
-		b.showOutput(a, p.Dir, p.ImportPath, b.processOutput(out)) // swig warning
+		b.showOutput(a, p.Dir, p.Desc(), b.processOutput(out)) // swig warning
 	}
 
 	// If the input was x.swig, the output is x.go in the objdir.
@@ -2437,3 +2753,78 @@
 	}
 	return abs
 }
+
+// passLongArgsInResponseFiles modifies cmd on Windows such that, for
+// certain programs, long arguments are passed in "response files", a
+// file on disk with the arguments, with one arg per line. An actual
+// argument starting with '@' means that the rest of the argument is
+// a filename of arguments to expand.
+//
+// See Issue 18468.
+func passLongArgsInResponseFiles(cmd *exec.Cmd) (cleanup func()) {
+	cleanup = func() {} // no cleanup by default
+
+	var argLen int
+	for _, arg := range cmd.Args {
+		argLen += len(arg)
+	}
+
+	// If we're not approaching 32KB of args, just pass args normally.
+	// (use 30KB instead to be conservative; not sure how accounting is done)
+	if !useResponseFile(cmd.Path, argLen) {
+		return
+	}
+
+	tf, err := ioutil.TempFile("", "args")
+	if err != nil {
+		log.Fatalf("error writing long arguments to response file: %v", err)
+	}
+	cleanup = func() { os.Remove(tf.Name()) }
+	var buf bytes.Buffer
+	for _, arg := range cmd.Args[1:] {
+		fmt.Fprintf(&buf, "%s\n", arg)
+	}
+	if _, err := tf.Write(buf.Bytes()); err != nil {
+		tf.Close()
+		cleanup()
+		log.Fatalf("error writing long arguments to response file: %v", err)
+	}
+	if err := tf.Close(); err != nil {
+		cleanup()
+		log.Fatalf("error writing long arguments to response file: %v", err)
+	}
+	cmd.Args = []string{cmd.Args[0], "@" + tf.Name()}
+	return cleanup
+}
+
+func useResponseFile(path string, argLen int) bool {
+	// Unless we're on Windows, don't use response files.
+	if runtime.GOOS != "windows" {
+		return false
+	}
+
+	// Unless the program uses objabi.Flagparse, which understands
+	// response files, don't use response files.
+	// TODO: do we need more commands? asm? cgo? For now, no.
+	prog := strings.TrimSuffix(filepath.Base(path), ".exe")
+	switch prog {
+	case "compile", "link":
+	default:
+		return false
+	}
+
+	// Windows has a limit of 32 KB arguments. To be conservative and not
+	// worry about whether that includes spaces or not, just use 30 KB.
+	if argLen > (30 << 10) {
+		return true
+	}
+
+	// On the Go build system, use response files about 10% of the
+	// time, just to excercise this codepath.
+	isBuilder := os.Getenv("GO_BUILDER_NAME") != ""
+	if isBuilder && rand.Intn(10) == 0 {
+		return true
+	}
+
+	return false
+}
diff --git a/vendor/cmd/go/internal/work/gc.go b/vendor/cmd/go/internal/work/gc.go
index 9faa25a..c09a8a2 100644
--- a/vendor/cmd/go/internal/work/gc.go
+++ b/vendor/cmd/go/internal/work/gc.go
@@ -56,9 +56,14 @@
 		gcargs = append(gcargs, "-std")
 	}
 	compilingRuntime := p.Standard && (p.ImportPath == "runtime" || strings.HasPrefix(p.ImportPath, "runtime/internal"))
+	// The runtime package imports a couple of general internal packages.
+	if p.Standard && (p.ImportPath == "internal/cpu" || p.ImportPath == "internal/bytealg") {
+		compilingRuntime = true
+	}
 	if compilingRuntime {
-		// runtime compiles with a special gc flag to emit
-		// additional reflect type data.
+		// runtime compiles with a special gc flag to check for
+		// memory allocations that are invalid in the runtime package,
+		// and to implement some special compiler pragmas.
 		gcargs = append(gcargs, "-+")
 	}
 
@@ -83,7 +88,7 @@
 		gcargs = append(gcargs, "-buildid", a.buildID)
 	}
 	platform := cfg.Goos + "/" + cfg.Goarch
-	if p.Internal.OmitDebug || platform == "nacl/amd64p32" || platform == "darwin/arm" || platform == "darwin/arm64" || cfg.Goos == "plan9" {
+	if p.Internal.OmitDebug || platform == "nacl/amd64p32" || cfg.Goos == "plan9" || cfg.Goarch == "wasm" {
 		gcargs = append(gcargs, "-dwarf=false")
 	}
 	if strings.HasPrefix(runtimeVersion, "go1") && !strings.Contains(os.Args[0], "go_bootstrap") {
@@ -127,7 +132,7 @@
 		args = append(args, mkAbs(p.Dir, f))
 	}
 
-	output, err = b.runOut(p.Dir, p.ImportPath, nil, args...)
+	output, err = b.runOut(p.Dir, nil, args...)
 	return ofile, output, err
 }
 
@@ -222,6 +227,11 @@
 		args = append(args, "-D", "GOMIPS_"+cfg.GOMIPS)
 	}
 
+	if cfg.Goarch == "mips64" || cfg.Goarch == "mips64le" {
+		// Define GOMIPS64_value from cfg.GOMIPS64.
+		args = append(args, "-D", "GOMIPS64_"+cfg.GOMIPS64)
+	}
+
 	var ofiles []string
 	for _, sfile := range sfiles {
 		ofile := a.Objdir + sfile[:len(sfile)-len(".s")] + ".o"
@@ -283,14 +293,14 @@
 	if cfg.BuildN {
 		return nil
 	}
-	if err := packInternal(b, absAfile, absOfiles); err != nil {
-		b.showOutput(a, p.Dir, p.ImportPath, err.Error()+"\n")
+	if err := packInternal(absAfile, absOfiles); err != nil {
+		b.showOutput(a, p.Dir, p.Desc(), err.Error()+"\n")
 		return errPrintedOutput
 	}
 	return nil
 }
 
-func packInternal(b *Builder, afile string, ofiles []string) error {
+func packInternal(afile string, ofiles []string) error {
 	dst, err := os.OpenFile(afile, os.O_WRONLY|os.O_APPEND, 0)
 	if err != nil {
 		return err
diff --git a/vendor/cmd/go/internal/work/gccgo.go b/vendor/cmd/go/internal/work/gccgo.go
index 2512ffe..91daf52 100644
--- a/vendor/cmd/go/internal/work/gccgo.go
+++ b/vendor/cmd/go/internal/work/gccgo.go
@@ -85,7 +85,7 @@
 		args = append(args, mkAbs(p.Dir, f))
 	}
 
-	output, err = b.runOut(p.Dir, p.ImportPath, nil, args)
+	output, err = b.runOut(p.Dir, nil, args)
 	return ofile, output, err
 }
 
@@ -232,7 +232,7 @@
 	readAndRemoveCgoFlags := func(archive string) (string, error) {
 		newID++
 		newArchive := root.Objdir + fmt.Sprintf("_pkg%d_.a", newID)
-		if err := b.copyFile(root, newArchive, archive, 0666, false); err != nil {
+		if err := b.copyFile(newArchive, archive, 0666, false); err != nil {
 			return "", err
 		}
 		if cfg.BuildN || cfg.BuildX {
diff --git a/vendor/cmd/go/internal/work/init.go b/vendor/cmd/go/internal/work/init.go
index 7f894f5..1081e51 100644
--- a/vendor/cmd/go/internal/work/init.go
+++ b/vendor/cmd/go/internal/work/init.go
@@ -39,15 +39,20 @@
 		fmt.Fprintf(os.Stderr, "go %s: may not use -race and -msan simultaneously\n", flag.Args()[0])
 		os.Exit(2)
 	}
-	if cfg.BuildMSan && (cfg.Goos != "linux" || cfg.Goarch != "amd64") {
+	if cfg.BuildMSan && (cfg.Goos != "linux" || cfg.Goarch != "amd64" && cfg.Goarch != "arm64") {
 		fmt.Fprintf(os.Stderr, "-msan is not supported on %s/%s\n", cfg.Goos, cfg.Goarch)
 		os.Exit(2)
 	}
-	if cfg.Goarch != "amd64" || cfg.Goos != "linux" && cfg.Goos != "freebsd" && cfg.Goos != "darwin" && cfg.Goos != "windows" {
-		fmt.Fprintf(os.Stderr, "go %s: -race and -msan are only supported on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0])
-		os.Exit(2)
+	if cfg.BuildRace {
+		platform := cfg.Goos + "/" + cfg.Goarch
+		switch platform {
+		default:
+			fmt.Fprintf(os.Stderr, "go %s: -race is only supported on linux/amd64, linux/ppc64le, freebsd/amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0])
+			os.Exit(2)
+		case "linux/amd64", "linux/ppc64le", "freebsd/amd64", "darwin/amd64", "windows/amd64":
+			// race supported on these platforms
+		}
 	}
-
 	mode := "race"
 	if cfg.BuildMSan {
 		mode = "msan"
@@ -83,6 +88,9 @@
 		default:
 			switch cfg.Goos {
 			case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris":
+				if platform == "linux/ppc64" {
+					base.Fatalf("-buildmode=c-archive not supported on %s\n", platform)
+				}
 				// Use -shared so that the result is
 				// suitable for inclusion in a PIE or
 				// shared library.
@@ -98,7 +106,8 @@
 		} else {
 			switch platform {
 			case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/ppc64le", "linux/s390x",
-				"android/amd64", "android/arm", "android/arm64", "android/386":
+				"android/amd64", "android/arm", "android/arm64", "android/386",
+				"freebsd/amd64":
 				codegenArg = "-shared"
 			case "darwin/amd64", "darwin/386":
 			case "windows/amd64", "windows/386":
@@ -138,7 +147,8 @@
 		} else {
 			switch platform {
 			case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x",
-				"android/amd64", "android/arm", "android/arm64", "android/386":
+				"android/amd64", "android/arm", "android/arm64", "android/386",
+				"freebsd/amd64":
 				codegenArg = "-shared"
 			case "darwin/amd64":
 				codegenArg = "-shared"
diff --git a/vendor/cmd/go/internal/work/security.go b/vendor/cmd/go/internal/work/security.go
index 54fd6b9..cd39a8f 100644
--- a/vendor/cmd/go/internal/work/security.go
+++ b/vendor/cmd/go/internal/work/security.go
@@ -41,48 +41,89 @@
 
 var validCompilerFlags = []*regexp.Regexp{
 	re(`-D([A-Za-z_].*)`),
+	re(`-F([^@\-].*)`),
 	re(`-I([^@\-].*)`),
 	re(`-O`),
 	re(`-O([^@\-].*)`),
 	re(`-W`),
 	re(`-W([^@,]+)`), // -Wall but not -Wa,-foo.
+	re(`-Wa,-mbig-obj`),
+	re(`-Wp,-D([A-Za-z_].*)`),
+	re(`-ansi`),
+	re(`-f(no-)?asynchronous-unwind-tables`),
 	re(`-f(no-)?blocks`),
+	re(`-f(no-)builtin-[a-zA-Z0-9_]*`),
 	re(`-f(no-)?common`),
 	re(`-f(no-)?constant-cfstrings`),
+	re(`-fdiagnostics-show-note-include-stack`),
+	re(`-f(no-)?eliminate-unused-debug-types`),
 	re(`-f(no-)?exceptions`),
+	re(`-f(no-)?fast-math`),
+	re(`-f(no-)?inline-functions`),
 	re(`-finput-charset=([^@\-].*)`),
+	re(`-f(no-)?fat-lto-objects`),
+	re(`-f(no-)?keep-inline-dllexport`),
 	re(`-f(no-)?lto`),
+	re(`-fmacro-backtrace-limit=(.+)`),
+	re(`-fmessage-length=(.+)`),
 	re(`-f(no-)?modules`),
 	re(`-f(no-)?objc-arc`),
+	re(`-f(no-)?objc-nonfragile-abi`),
+	re(`-f(no-)?objc-legacy-dispatch`),
 	re(`-f(no-)?omit-frame-pointer`),
 	re(`-f(no-)?openmp(-simd)?`),
 	re(`-f(no-)?permissive`),
 	re(`-f(no-)?(pic|PIC|pie|PIE)`),
+	re(`-f(no-)?plt`),
 	re(`-f(no-)?rtti`),
 	re(`-f(no-)?split-stack`),
 	re(`-f(no-)?stack-(.+)`),
 	re(`-f(no-)?strict-aliasing`),
+	re(`-f(un)signed-char`),
+	re(`-f(no-)?use-linker-plugin`), // safe if -B is not used; we don't permit -B
+	re(`-f(no-)?visibility-inlines-hidden`),
 	re(`-fsanitize=(.+)`),
+	re(`-ftemplate-depth-(.+)`),
+	re(`-fvisibility=(.+)`),
 	re(`-g([^@\-].*)?`),
-	re(`-m(arch|cpu|fpu|tune)=([^@\-].*)`),
+	re(`-m32`),
+	re(`-m64`),
+	re(`-m(abi|arch|cpu|fpu|tune)=([^@\-].*)`),
+	re(`-marm`),
+	re(`-mfloat-abi=([^@\-].*)`),
+	re(`-mfpmath=[0-9a-z,+]*`),
 	re(`-m(no-)?avx[0-9a-z.]*`),
 	re(`-m(no-)?ms-bitfields`),
 	re(`-m(no-)?stack-(.+)`),
 	re(`-mmacosx-(.+)`),
+	re(`-mios-simulator-version-min=(.+)`),
+	re(`-miphoneos-version-min=(.+)`),
 	re(`-mnop-fun-dllimport`),
 	re(`-m(no-)?sse[0-9.]*`),
+	re(`-mthumb(-interwork)?`),
+	re(`-mthreads`),
+	re(`-mwindows`),
+	re(`--param=ssp-buffer-size=[0-9]*`),
 	re(`-pedantic(-errors)?`),
 	re(`-pipe`),
 	re(`-pthread`),
 	re(`-?-std=([^@\-].*)`),
+	re(`-?-stdlib=([^@\-].*)`),
+	re(`--sysroot=([^@\-].*)`),
+	re(`-w`),
 	re(`-x([^@\-].*)`),
+	re(`-v`),
 }
 
 var validCompilerFlagsWithNextArg = []string{
+	"-arch",
 	"-D",
 	"-I",
-	"-isystem",
 	"-framework",
+	"-isysroot",
+	"-isystem",
+	"--sysroot",
+	"-target",
 	"-x",
 }
 
@@ -90,43 +131,77 @@
 	re(`-F([^@\-].*)`),
 	re(`-l([^@\-].*)`),
 	re(`-L([^@\-].*)`),
+	re(`-O`),
+	re(`-O([^@\-].*)`),
 	re(`-f(no-)?(pic|PIC|pie|PIE)`),
+	re(`-f(no-)?openmp(-simd)?`),
 	re(`-fsanitize=([^@\-].*)`),
 	re(`-g([^@\-].*)?`),
-	re(`-m(arch|cpu|fpu|tune)=([^@\-].*)`),
+	re(`-headerpad_max_install_names`),
+	re(`-m(abi|arch|cpu|fpu|tune)=([^@\-].*)`),
+	re(`-mfloat-abi=([^@\-].*)`),
+	re(`-mmacosx-(.+)`),
+	re(`-mios-simulator-version-min=(.+)`),
+	re(`-miphoneos-version-min=(.+)`),
+	re(`-mthreads`),
+	re(`-mwindows`),
 	re(`-(pic|PIC|pie|PIE)`),
 	re(`-pthread`),
+	re(`-rdynamic`),
+	re(`-shared`),
 	re(`-?-static([-a-z0-9+]*)`),
+	re(`-?-stdlib=([^@\-].*)`),
+	re(`-v`),
 
 	// Note that any wildcards in -Wl need to exclude comma,
 	// since -Wl splits its argument at commas and passes
 	// them all to the linker uninterpreted. Allowing comma
 	// in a wildcard would allow tunnelling arbitrary additional
 	// linker arguments through one of these.
+	re(`-Wl,--(no-)?allow-multiple-definition`),
+	re(`-Wl,--(no-)?allow-shlib-undefined`),
 	re(`-Wl,--(no-)?as-needed`),
 	re(`-Wl,-Bdynamic`),
 	re(`-Wl,-Bstatic`),
+	re(`-WL,-O([^@,\-][^,]*)?`),
+	re(`-Wl,-d[ny]`),
 	re(`-Wl,--disable-new-dtags`),
+	re(`-Wl,-e[=,][a-zA-Z0-9]*`),
 	re(`-Wl,--enable-new-dtags`),
 	re(`-Wl,--end-group`),
 	re(`-Wl,-framework,[^,@\-][^,]+`),
 	re(`-Wl,-headerpad_max_install_names`),
 	re(`-Wl,--no-undefined`),
-	re(`-Wl,-rpath,([^,@\-][^,]+)`),
+	re(`-Wl,-rpath(-link)?[=,]([^,@\-][^,]+)`),
+	re(`-Wl,-s`),
 	re(`-Wl,-search_paths_first`),
+	re(`-Wl,-sectcreate,([^,@\-][^,]+),([^,@\-][^,]+),([^,@\-][^,]+)`),
 	re(`-Wl,--start-group`),
+	re(`-Wl,-?-static`),
+	re(`-Wl,-?-subsystem,(native|windows|console|posix|xbox)`),
+	re(`-Wl,-syslibroot[=,]([^,@\-][^,]+)`),
+	re(`-Wl,-undefined[=,]([^,@\-][^,]+)`),
 	re(`-Wl,-?-unresolved-symbols=[^,]+`),
 	re(`-Wl,--(no-)?warn-([^,]+)`),
+	re(`-Wl,-z,(no)?execstack`),
+	re(`-Wl,-z,relro`),
 
 	re(`[a-zA-Z0-9_/].*\.(a|o|obj|dll|dylib|so)`), // direct linker inputs: x.o or libfoo.so (but not -foo.o or @foo.o)
+	re(`\./.*\.(a|o|obj|dll|dylib|so)`),
 }
 
 var validLinkerFlagsWithNextArg = []string{
+	"-arch",
 	"-F",
 	"-l",
 	"-L",
 	"-framework",
+	"-isysroot",
+	"--sysroot",
+	"-target",
 	"-Wl,-framework",
+	"-Wl,-rpath",
+	"-Wl,-undefined",
 }
 
 func checkCompilerFlags(name, source string, list []string) error {
diff --git a/vendor/cmd/go/internal/work/security_test.go b/vendor/cmd/go/internal/work/security_test.go
index 976501b..d23b6ea 100644
--- a/vendor/cmd/go/internal/work/security_test.go
+++ b/vendor/cmd/go/internal/work/security_test.go
@@ -12,6 +12,7 @@
 var goodCompilerFlags = [][]string{
 	{"-DFOO"},
 	{"-Dfoo=bar"},
+	{"-F/Qt"},
 	{"-I/"},
 	{"-I/etc/passwd"},
 	{"-I."},
@@ -57,11 +58,14 @@
 	{"-I", "世界"},
 	{"-framework", "Chocolate"},
 	{"-x", "c"},
+	{"-v"},
 }
 
 var badCompilerFlags = [][]string{
 	{"-D@X"},
 	{"-D-X"},
+	{"-F@dir"},
+	{"-F-dir"},
 	{"-I@dir"},
 	{"-I-dir"},
 	{"-O@1"},
@@ -125,6 +129,7 @@
 	{"-Wl,--no-warn-error"},
 	{"foo.so"},
 	{"_世界.dll"},
+	{"./x.o"},
 	{"libcgosotest.dylib"},
 	{"-F", "framework"},
 	{"-l", "."},
@@ -132,6 +137,7 @@
 	{"-l", "世界"},
 	{"-L", "framework"},
 	{"-framework", "Chocolate"},
+	{"-v"},
 	{"-Wl,-framework", "-Wl,Chocolate"},
 	{"-Wl,-framework,Chocolate"},
 	{"-Wl,-unresolved-symbols=ignore-all"},
@@ -140,9 +146,6 @@
 var badLinkerFlags = [][]string{
 	{"-DFOO"},
 	{"-Dfoo=bar"},
-	{"-O"},
-	{"-O2"},
-	{"-Osmall"},
 	{"-W"},
 	{"-Wall"},
 	{"-fobjc-arc"},
@@ -155,7 +158,6 @@
 	{"-fno-stack-xxx"},
 	{"-mstack-overflow"},
 	{"-mno-stack-overflow"},
-	{"-mmacosx-version"},
 	{"-mnop-fun-dllimport"},
 	{"-std=c99"},
 	{"-xc"},
@@ -195,6 +197,7 @@
 	{"-x", "--c"},
 	{"-x", "@obj"},
 	{"-Wl,-rpath,@foo"},
+	{"../x.o"},
 }
 
 func TestCheckLinkerFlags(t *testing.T) {
diff --git a/vendor/cmd/go/mkalldocs.sh b/vendor/cmd/go/mkalldocs.sh
index bc5009d..9a4024e 100755
--- a/vendor/cmd/go/mkalldocs.sh
+++ b/vendor/cmd/go/mkalldocs.sh
@@ -5,7 +5,7 @@
 
 set -e
 
-go build -o go.latest
-./go.latest help documentation | sed 's/^package main/&_/' >alldocs.go
+go build -o go.latest golang.org/x/vgo
+./go.latest help documentation | sed 's/^package main/package Main/' >alldocs.go
 gofmt -w alldocs.go
 rm go.latest
diff --git a/vendor/cmd/go/testdata/importcycle/src/selfimport/selfimport.go b/vendor/cmd/go/testdata/importcycle/src/selfimport/selfimport.go
new file mode 100644
index 0000000..dc63c4b
--- /dev/null
+++ b/vendor/cmd/go/testdata/importcycle/src/selfimport/selfimport.go
@@ -0,0 +1,3 @@
+package selfimport
+
+import "selfimport"
diff --git a/vendor/cmd/go/testdata/modlegacy/src/new/go.mod b/vendor/cmd/go/testdata/modlegacy/src/new/go.mod
new file mode 100644
index 0000000..d0dd46d
--- /dev/null
+++ b/vendor/cmd/go/testdata/modlegacy/src/new/go.mod
@@ -0,0 +1 @@
+module "new/v2"
diff --git a/vendor/cmd/go/testdata/modlegacy/src/new/new.go b/vendor/cmd/go/testdata/modlegacy/src/new/new.go
new file mode 100644
index 0000000..e99c47a
--- /dev/null
+++ b/vendor/cmd/go/testdata/modlegacy/src/new/new.go
@@ -0,0 +1,3 @@
+package new
+
+import _ "new/v2/p2"
diff --git a/vendor/cmd/go/testdata/modlegacy/src/new/p1/p1.go b/vendor/cmd/go/testdata/modlegacy/src/new/p1/p1.go
new file mode 100644
index 0000000..4539f40
--- /dev/null
+++ b/vendor/cmd/go/testdata/modlegacy/src/new/p1/p1.go
@@ -0,0 +1,7 @@
+package p1
+
+import _ "old/p2"
+import _ "new/v2"
+import _ "new/v2/p2"
+import _ "new/sub/v2/x/v1/y" // v2 is module, v1 is directory in module
+import _ "new/sub/inner/x"   // new/sub/inner/go.mod overrides new/sub/go.mod
diff --git a/vendor/cmd/go/testdata/modlegacy/src/new/p2/p2.go b/vendor/cmd/go/testdata/modlegacy/src/new/p2/p2.go
new file mode 100644
index 0000000..9b9052f
--- /dev/null
+++ b/vendor/cmd/go/testdata/modlegacy/src/new/p2/p2.go
@@ -0,0 +1 @@
+package p2
diff --git a/vendor/cmd/go/testdata/modlegacy/src/new/sub/go.mod b/vendor/cmd/go/testdata/modlegacy/src/new/sub/go.mod
new file mode 100644
index 0000000..484d20c
--- /dev/null
+++ b/vendor/cmd/go/testdata/modlegacy/src/new/sub/go.mod
@@ -0,0 +1 @@
+module new/sub/v2
diff --git a/vendor/cmd/go/testdata/modlegacy/src/new/sub/inner/go.mod b/vendor/cmd/go/testdata/modlegacy/src/new/sub/inner/go.mod
new file mode 100644
index 0000000..ba39345
--- /dev/null
+++ b/vendor/cmd/go/testdata/modlegacy/src/new/sub/inner/go.mod
@@ -0,0 +1 @@
+module new/sub/inner
diff --git a/vendor/cmd/go/testdata/vendormod/vendor/x/x.go b/vendor/cmd/go/testdata/modlegacy/src/new/sub/inner/x/x.go
similarity index 100%
rename from vendor/cmd/go/testdata/vendormod/vendor/x/x.go
rename to vendor/cmd/go/testdata/modlegacy/src/new/sub/inner/x/x.go
diff --git a/vendor/cmd/go/testdata/vendormod/vendor/y/y.go b/vendor/cmd/go/testdata/modlegacy/src/new/sub/x/v1/y/y.go
similarity index 100%
rename from vendor/cmd/go/testdata/vendormod/vendor/y/y.go
rename to vendor/cmd/go/testdata/modlegacy/src/new/sub/x/v1/y/y.go
diff --git a/vendor/cmd/go/testdata/modlegacy/src/old/p1/p1.go b/vendor/cmd/go/testdata/modlegacy/src/old/p1/p1.go
new file mode 100644
index 0000000..9052748
--- /dev/null
+++ b/vendor/cmd/go/testdata/modlegacy/src/old/p1/p1.go
@@ -0,0 +1,5 @@
+package p1
+
+import _ "old/p2"
+import _ "new/p1"
+import _ "new"
diff --git a/vendor/cmd/go/testdata/modlegacy/src/old/p2/p2.go b/vendor/cmd/go/testdata/modlegacy/src/old/p2/p2.go
new file mode 100644
index 0000000..9b9052f
--- /dev/null
+++ b/vendor/cmd/go/testdata/modlegacy/src/old/p2/p2.go
@@ -0,0 +1 @@
+package p2
diff --git a/vendor/cmd/go/testdata/src/dupload/p2/p2.go b/vendor/cmd/go/testdata/src/dupload/p2/p2.go
index 40f5a5b..8a80979 100644
--- a/vendor/cmd/go/testdata/src/dupload/p2/p2.go
+++ b/vendor/cmd/go/testdata/src/dupload/p2/p2.go
@@ -1,2 +1,3 @@
 package p2
+
 import _ "dupload/vendor/p"
diff --git a/vendor/cmd/go/testdata/src/exclude/x_linux.go b/vendor/cmd/go/testdata/src/exclude/x_linux.go
index a5bbb61..41ef6e5 100644
--- a/vendor/cmd/go/testdata/src/exclude/x_linux.go
+++ b/vendor/cmd/go/testdata/src/exclude/x_linux.go
@@ -1,4 +1,3 @@
 // +build windows
 
 package x
-
diff --git a/vendor/cmd/go/testdata/src/failfast_test.go b/vendor/cmd/go/testdata/src/failfast_test.go
index fef4d2a..6e64d73 100644
--- a/vendor/cmd/go/testdata/src/failfast_test.go
+++ b/vendor/cmd/go/testdata/src/failfast_test.go
@@ -52,3 +52,11 @@
 func TestFailingB(t *testing.T) {
 	t.Errorf("FAIL - %s", t.Name())
 }
+
+func TestFatalC(t *testing.T) {
+	t.Fatalf("FAIL - %s", t.Name())
+}
+
+func TestFatalD(t *testing.T) {
+	t.Fatalf("FAIL - %s", t.Name())
+}
diff --git a/vendor/cmd/go/testdata/src/hello/hello.go b/vendor/cmd/go/testdata/src/hello/hello.go
new file mode 100644
index 0000000..73d83e6
--- /dev/null
+++ b/vendor/cmd/go/testdata/src/hello/hello.go
@@ -0,0 +1,5 @@
+package main
+
+func main() {
+	println("hello, world")
+}
diff --git a/vendor/cmd/go/testdata/src/my.pkg/main/main.go b/vendor/cmd/go/testdata/src/my.pkg/main/main.go
index 397e8b6..c3e8de1 100644
--- a/vendor/cmd/go/testdata/src/my.pkg/main/main.go
+++ b/vendor/cmd/go/testdata/src/my.pkg/main/main.go
@@ -1,5 +1,7 @@
 package main
+
 import "my.pkg"
+
 func main() {
 	println(pkg.Text)
 }
diff --git a/vendor/cmd/go/testdata/src/vetcycle/p.go b/vendor/cmd/go/testdata/src/vetcycle/p.go
index 857c3a6..5b058e7 100644
--- a/vendor/cmd/go/testdata/src/vetcycle/p.go
+++ b/vendor/cmd/go/testdata/src/vetcycle/p.go
@@ -1,11 +1,12 @@
 package p
 
-
 type (
-	_ interface{ m(B1) }
+	_  interface{ m(B1) }
 	A1 interface{ a(D1) }
 	B1 interface{ A1 }
-	C1 interface{ B1 /* ERROR issue #18395 */ }
+	C1 interface {
+		B1 /* ERROR issue #18395 */
+	}
 	D1 interface{ C1 }
 )
 
diff --git a/vendor/cmd/go/testdata/testcover/pkg1/a.go b/vendor/cmd/go/testdata/testcover/pkg1/a.go
new file mode 100644
index 0000000..e291611
--- /dev/null
+++ b/vendor/cmd/go/testdata/testcover/pkg1/a.go
@@ -0,0 +1,7 @@
+package pkg1
+
+import "fmt"
+
+func F() {
+	fmt.Println("pkg1")
+}
diff --git a/vendor/cmd/go/testdata/testcover/pkg2/a.go b/vendor/cmd/go/testdata/testcover/pkg2/a.go
new file mode 100644
index 0000000..7bd9bd4
--- /dev/null
+++ b/vendor/cmd/go/testdata/testcover/pkg2/a.go
@@ -0,0 +1,7 @@
+package pkg2
+
+import "fmt"
+
+func F() {
+	fmt.Println("pkg2")
+}
diff --git a/vendor/cmd/go/testdata/testcover/pkg2/a_test.go b/vendor/cmd/go/testdata/testcover/pkg2/a_test.go
new file mode 100644
index 0000000..4f791ad
--- /dev/null
+++ b/vendor/cmd/go/testdata/testcover/pkg2/a_test.go
@@ -0,0 +1 @@
+package pkg2
diff --git a/vendor/cmd/go/testdata/testcover/pkg3/a.go b/vendor/cmd/go/testdata/testcover/pkg3/a.go
new file mode 100644
index 0000000..bf86ed8
--- /dev/null
+++ b/vendor/cmd/go/testdata/testcover/pkg3/a.go
@@ -0,0 +1,7 @@
+package pkg3
+
+import "fmt"
+
+func F() {
+	fmt.Println("pkg3")
+}
diff --git a/vendor/cmd/go/testdata/testcover/pkg3/a_test.go b/vendor/cmd/go/testdata/testcover/pkg3/a_test.go
new file mode 100644
index 0000000..39c2c5a
--- /dev/null
+++ b/vendor/cmd/go/testdata/testcover/pkg3/a_test.go
@@ -0,0 +1,7 @@
+package pkg3
+
+import "testing"
+
+func TestF(t *testing.T) {
+	F()
+}
diff --git a/vendor/cmd/go/testdata/vendormod/vendor/vgo.list b/vendor/cmd/go/testdata/vendormod/vendor/vgo.list
deleted file mode 100644
index e8bd2c5..0000000
--- a/vendor/cmd/go/testdata/vendormod/vendor/vgo.list
+++ /dev/null
@@ -1,6 +0,0 @@
-# x v1.0.0 => ./x
-x
-# y v1.0.0 => ./y
-y
-# z v1.0.0 => ./z
-z
diff --git a/vendor/cmd/go/testdata/vendormod/vendor/x/go.mod b/vendor/cmd/go/testdata/vendormod/vendor/x/go.mod
deleted file mode 100644
index c191435..0000000
--- a/vendor/cmd/go/testdata/vendormod/vendor/x/go.mod
+++ /dev/null
@@ -1 +0,0 @@
-module x
diff --git a/vendor/cmd/go/testdata/vendormod/vendor/y/go.mod b/vendor/cmd/go/testdata/vendormod/vendor/y/go.mod
deleted file mode 100644
index ac82a48..0000000
--- a/vendor/cmd/go/testdata/vendormod/vendor/y/go.mod
+++ /dev/null
@@ -1 +0,0 @@
-module y
diff --git a/vendor/cmd/go/testdata/vendormod/vendor/z/go.mod b/vendor/cmd/go/testdata/vendormod/vendor/z/go.mod
deleted file mode 100644
index efc58fe..0000000
--- a/vendor/cmd/go/testdata/vendormod/vendor/z/go.mod
+++ /dev/null
@@ -1 +0,0 @@
-module z
diff --git a/vendor/cmd/go/testdata/vendormod/vendor/z/z.go b/vendor/cmd/go/testdata/vendormod/vendor/z/z.go
deleted file mode 100644
index 46458cb..0000000
--- a/vendor/cmd/go/testdata/vendormod/vendor/z/z.go
+++ /dev/null
@@ -1 +0,0 @@
-package z
diff --git a/vendor/cmd/go/vendor_test.go b/vendor/cmd/go/vendor_test.go
index e276828..c2b3d6a 100644
--- a/vendor/cmd/go/vendor_test.go
+++ b/vendor/cmd/go/vendor_test.go
@@ -10,6 +10,7 @@
 	"bytes"
 	"fmt"
 	"internal/testenv"
+	"os"
 	"path/filepath"
 	"regexp"
 	"strings"
@@ -328,3 +329,75 @@
 	tg.grepStderrNot("panic", "panicked")
 	tg.grepStderr(`cannot find package "x"`, "wrong error")
 }
+
+// Module legacy support does path rewriting very similar to vendoring.
+
+func TestModLegacy(t *testing.T) {
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata/modlegacy"))
+	tg.run("list", "-f", "{{.Imports}}", "old/p1")
+	tg.grepStdout("new/p1", "old/p1 should import new/p1")
+	tg.run("list", "-f", "{{.Imports}}", "new/p1")
+	tg.grepStdout("new/p2", "new/p1 should import new/p2 (not new/v2/p2)")
+	tg.grepStdoutNot("new/v2", "new/p1 should NOT import new/v2*")
+	tg.grepStdout("new/sub/x/v1/y", "new/p1 should import new/sub/x/v1/y (not new/sub/v2/x/v1/y)")
+	tg.grepStdoutNot("new/sub/v2", "new/p1 should NOT import new/sub/v2*")
+	tg.grepStdout("new/sub/inner/x", "new/p1 should import new/sub/inner/x (no rewrites)")
+	tg.run("build", "old/p1", "new/p1")
+}
+
+func TestModLegacyGet(t *testing.T) {
+	testenv.MustHaveExternalNetwork(t)
+
+	tg := testgo(t)
+	defer tg.cleanup()
+	tg.makeTempdir()
+	tg.setenv("GOPATH", tg.path("d1"))
+	tg.run("get", "vcs-test.golang.org/git/modlegacy1-old.git/p1")
+	tg.run("list", "-f", "{{.Deps}}", "vcs-test.golang.org/git/modlegacy1-old.git/p1")
+	tg.grepStdout("new.git/p2", "old/p1 should depend on new/p2")
+	tg.grepStdoutNot("new.git/v2/p2", "old/p1 should NOT depend on new/v2/p2")
+	tg.run("build", "vcs-test.golang.org/git/modlegacy1-old.git/p1", "vcs-test.golang.org/git/modlegacy1-new.git/p1")
+
+	tg.setenv("GOPATH", tg.path("d2"))
+
+	tg.must(os.RemoveAll(tg.path("d2")))
+	tg.run("get", "github.com/rsc/vgotest5")
+	tg.run("get", "github.com/rsc/vgotest4")
+	tg.run("get", "github.com/myitcv/vgo_example_compat")
+
+	if testing.Short() {
+		return
+	}
+
+	tg.must(os.RemoveAll(tg.path("d2")))
+	tg.run("get", "github.com/rsc/vgotest4")
+	tg.run("get", "github.com/rsc/vgotest5")
+	tg.run("get", "github.com/myitcv/vgo_example_compat")
+
+	tg.must(os.RemoveAll(tg.path("d2")))
+	tg.run("get", "github.com/rsc/vgotest4", "github.com/rsc/vgotest5")
+	tg.run("get", "github.com/myitcv/vgo_example_compat")
+
+	tg.must(os.RemoveAll(tg.path("d2")))
+	tg.run("get", "github.com/rsc/vgotest5", "github.com/rsc/vgotest4")
+	tg.run("get", "github.com/myitcv/vgo_example_compat")
+
+	tg.must(os.RemoveAll(tg.path("d2")))
+	tg.run("get", "github.com/myitcv/vgo_example_compat")
+	tg.run("get", "github.com/rsc/vgotest4", "github.com/rsc/vgotest5")
+
+	pkgs := []string{"github.com/myitcv/vgo_example_compat", "github.com/rsc/vgotest4", "github.com/rsc/vgotest5"}
+	for i := 0; i < 3; i++ {
+		for j := 0; j < 3; j++ {
+			for k := 0; k < 3; k++ {
+				if i == j || i == k || k == j {
+					continue
+				}
+				tg.must(os.RemoveAll(tg.path("d2")))
+				tg.run("get", pkgs[i], pkgs[j], pkgs[k])
+			}
+		}
+	}
+}
diff --git a/vendor/cmd/go/vgo_test.go b/vendor/cmd/go/vgo_test.go
index d742333..694c150 100644
--- a/vendor/cmd/go/vgo_test.go
+++ b/vendor/cmd/go/vgo_test.go
@@ -289,7 +289,6 @@
 	defer tg.cleanup()
 	tg.makeTempdir()
 
-	tg.setenv("HOME", tg.path("."))
 	tg.must(os.MkdirAll(tg.path("x"), 0777))
 	tg.must(ioutil.WriteFile(tg.path("x/x.go"), []byte(`package x; import _ "github.com/gorilla/mux"`), 0666))
 	gomod := []byte(`
diff --git a/vendor/internal/race/race.go b/vendor/internal/race/race.go
new file mode 100644
index 0000000..6c10ec5
--- /dev/null
+++ b/vendor/internal/race/race.go
@@ -0,0 +1,3 @@
+package race
+
+const Enabled = false