diff options
author | Michael Matloob <matloob@golang.org> | 2021-08-02 15:54:51 -0400 |
---|---|---|
committer | Michael Matloob <matloob@golang.org> | 2021-08-12 16:19:55 +0000 |
commit | d397fc1169aa2491bc807812105371819366deb8 (patch) | |
tree | ad34cb6482847a9e8b9ca281c3db51c887d70a3a /src/cmd/go/testdata/script/mod_list_command_line_arguments.txt | |
parent | aaf914d0e69198a96683c106abb5a931c4956f88 (diff) | |
download | go-d397fc1169aa2491bc807812105371819366deb8.tar.gz go-d397fc1169aa2491bc807812105371819366deb8.zip |
[dev.cmdgo] don't give command-line-arguments a module
Don't associate command-line-arguments with a module. Even though the
sources in the command-line-arguments package may exist within the
module's packages, the command-line-arguments package is distinct from
the package in the module. It has its own identity, and further, even if
all the same sources are listed, build tag filtering is not applied for
command-line-arguments.
For #45713
Change-Id: I555752021d58ea25e65699b4959f787ea5fa2cda
Reviewed-on: https://go-review.googlesource.com/c/go/+/339170
Trust: Michael Matloob <matloob@golang.org>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/testdata/script/mod_list_command_line_arguments.txt')
-rw-r--r-- | src/cmd/go/testdata/script/mod_list_command_line_arguments.txt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/mod_list_command_line_arguments.txt b/src/cmd/go/testdata/script/mod_list_command_line_arguments.txt new file mode 100644 index 0000000000..fd99ae84b2 --- /dev/null +++ b/src/cmd/go/testdata/script/mod_list_command_line_arguments.txt @@ -0,0 +1,35 @@ +# The command-line-arguments package does not belong to a module... +cd a +go list -f '{{.Module}}' ../b/b.go +stdout '^<nil>$' + +# ... even if the arguments are sources from that module +go list -f '{{.Module}}' a.go +stdout '^<nil>$' + +[short] skip + +# check that the version of command-line-arguments doesn't include a module +go build -o a.exe a.go +go version -m a.exe +stdout '^\tpath\tcommand-line-arguments$' +stdout '^\tdep\ta\t\(devel\)\t$' +! stdout mod + +-- a/go.mod -- +module a +go 1.17 +-- a/a.go -- +package main + +import "a/dep" + +func main() { + dep.D() +} +-- a/dep/dep.go -- +package dep + +func D() {} +-- b/b.go -- +package b
\ No newline at end of file |