diff options
author | Bryan C. Mills <bcmills@google.com> | 2021-03-04 23:12:22 -0500 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2021-03-05 16:02:44 +0000 |
commit | 280c735b07af9ea313d73049b0031f466e8d1000 (patch) | |
tree | 883d40b1738acf45f1a31a2c13059122f0c2e3f6 /src/cmd/go/testdata/script/mod_outside.txt | |
parent | a2f70672334ecc71c81bd1f424e1734485d8cb83 (diff) | |
download | go-280c735b07af9ea313d73049b0031f466e8d1000.tar.gz go-280c735b07af9ea313d73049b0031f466e8d1000.zip |
cmd/go: require a module root in 'go list -m' with an unversioned path
Fixes #44803
Change-Id: Ie6ee2e3bca1809c91ecedec75d2c6620da914b29
Reviewed-on: https://go-review.googlesource.com/c/go/+/298752
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/testdata/script/mod_outside.txt')
-rw-r--r-- | src/cmd/go/testdata/script/mod_outside.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/mod_outside.txt b/src/cmd/go/testdata/script/mod_outside.txt index 9d4c22c77b..7c57db9f7c 100644 --- a/src/cmd/go/testdata/script/mod_outside.txt +++ b/src/cmd/go/testdata/script/mod_outside.txt @@ -61,6 +61,11 @@ stderr 'go: cannot match "all": go.mod file not found in current directory or an stderr 'go: cannot match "all": go.mod file not found in current directory or any parent directory; see ''go help modules''$' ! stdout 'example.com/version' +# 'go list -m <mods>' should fail if any of the mods lacks an explicit version. +! go list -m example.com/printversion +stderr 'go: cannot match "example.com/printversion" without -versions or an explicit version: go.mod file not found in current directory or any parent directory; see ''go help modules''$' +! 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 ... |