From 454198ab943a55a0609cfb10d14502a358e88101 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Mon, 27 Feb 2023 22:24:15 +0000 Subject: [PATCH] cmd/go: set GOWORK=off explicitly in script tests that cd to GOROOT Some folks working on the Go project may have a go.work file in GOROOT/src in order to test changes in x repos. 'go test cmd/go' should not fail if that is the case. For #58767. Change-Id: I0e57b15fb1d3e4abc4903c177434626c9f125cae Reviewed-on: https://go-review.googlesource.com/c/go/+/471601 TryBot-Result: Gopher Robot Auto-Submit: Bryan Mills Run-TryBot: Bryan Mills Reviewed-by: David Chase --- src/cmd/go/testdata/script/list_std_vendor.txt | 1 + src/cmd/go/testdata/script/mod_doc.txt | 1 + src/cmd/go/testdata/script/mod_list_std.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/src/cmd/go/testdata/script/list_std_vendor.txt b/src/cmd/go/testdata/script/list_std_vendor.txt index 8f27cc1e8d..923e95799d 100644 --- a/src/cmd/go/testdata/script/list_std_vendor.txt +++ b/src/cmd/go/testdata/script/list_std_vendor.txt @@ -28,5 +28,6 @@ cmp stdout $WORK/net-deps.txt [!net] stop env GOPROXY= +env GOWORK=off go mod why -m golang.org/x/net stdout '^# golang.org/x/net\nnet\ngolang.org/x/net' diff --git a/src/cmd/go/testdata/script/mod_doc.txt b/src/cmd/go/testdata/script/mod_doc.txt index 595ad679fc..bf0a19d770 100644 --- a/src/cmd/go/testdata/script/mod_doc.txt +++ b/src/cmd/go/testdata/script/mod_doc.txt @@ -50,6 +50,7 @@ stderr '^doc: cannot find module providing package example.com/hello: module loo cd $GOROOT/src env GOFLAGS= +env GOWORK=off go doc cryptobyte stdout '// import "golang.org/x/crypto/cryptobyte"' diff --git a/src/cmd/go/testdata/script/mod_list_std.txt b/src/cmd/go/testdata/script/mod_list_std.txt index cd95b6ad4d..7a4fe21823 100644 --- a/src/cmd/go/testdata/script/mod_list_std.txt +++ b/src/cmd/go/testdata/script/mod_list_std.txt @@ -36,6 +36,7 @@ stdout ^bytes$ # rules). cd $GOROOT/src +env GOWORK=off go list std stdout ^vendor/golang.org/x/net/http2/hpack -- 2.48.1