...
Text file
src/cmd/go/testdata/script/mod_list_command_line_arguments.txt
1# The command-line-arguments package does not belong to a module...
2cd a
3go list -f '{{.Module}}' ../b/b.go
4stdout '^<nil>$'
5
6# ... even if the arguments are sources from that module
7go list -f '{{.Module}}' a.go
8stdout '^<nil>$'
9
10[short] skip
11
12# check that the version of command-line-arguments doesn't include a module
13go build -o a.exe a.go
14go version -m a.exe
15stdout '^\tpath\tcommand-line-arguments$'
16stdout '^\tdep\ta\t\(devel\)\t$'
17! stdout mod[^e]
18
19-- a/go.mod --
20module a
21go 1.17
22-- a/a.go --
23package main
24
25import "a/dep"
26
27func main() {
28 dep.D()
29}
30-- a/dep/dep.go --
31package dep
32
33func D() {}
34-- b/b.go --
35package b
View as plain text