aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_outside.txt
diff options
context:
space:
mode:
authorJay Conrod <jayconrod@google.com>2019-11-21 12:50:14 -0500
committerJay Conrod <jayconrod@google.com>2019-11-21 19:09:24 +0000
commit2434869858e75872983038a7dc40df6e942bafba (patch)
tree597ef7ab179c7537307b361f7c00cfd1c9d3622c /src/cmd/go/testdata/script/mod_outside.txt
parent37715cce695e96d3d5a8e01f5009517121241330 (diff)
downloadgo-2434869858e75872983038a7dc40df6e942bafba.tar.gz
go-2434869858e75872983038a7dc40df6e942bafba.zip
cmd/go: report an error for 'go list -m ...' outside a module
Previously, we just reported an error for "all". Now we report an error for any pattern that matches modules in the build list. The build list can only contain the module "command-line-arguments", so these patterns are not meaningful. Fixes #35728 Change-Id: Ibc736491ec9164588f9657c09d1b9683b33cf1de Reviewed-on: https://go-review.googlesource.com/c/go/+/208222 Run-TryBot: Jay Conrod <jayconrod@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/go/testdata/script/mod_outside.txt')
-rw-r--r--src/cmd/go/testdata/script/mod_outside.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/mod_outside.txt b/src/cmd/go/testdata/script/mod_outside.txt
index 34570c76c2..03ef576168 100644
--- a/src/cmd/go/testdata/script/mod_outside.txt
+++ b/src/cmd/go/testdata/script/mod_outside.txt
@@ -56,6 +56,13 @@ stderr 'go: cannot match "all": working directory is not part of a module'
stderr 'go: cannot match "all": working directory is not part of a module'
! stdout 'example.com/version'
+# 'go list -m' with wildcards should fail. Wildcards match modules in the
+# build list, so they aren't meaningful outside a module.
+! go list -m ...
+stderr 'go: cannot match "...": working directory is not part of a module'
+! go list -m rsc.io/quote/...
+stderr 'go: cannot match "rsc.io/quote/...": working directory is not part of a module'
+
# 'go clean' should skip the current directory if it isn't in a module.
go clean -n