Text file
src/cmd/go/testdata/script/work_module_not_in_go_work.txt
1 # This is a regression test for issue #49632.
2 # The Go command should mention go.work if the user
3 # tries to load a local package that's in a module
4 # that's not in go.work and can't be resolved.
5
6 ! go list ./...
7 stderr 'pattern ./...: directory prefix . does not contain modules listed in go.work or their selected dependencies'
8
9 ! go list ./a
10 stderr 'directory a outside modules listed in go.work'
11
12 -- go.work --
13 go 1.18
14
15 use ./b
16 -- a/go.mod --
17 module example.com/a
18
19 go 1.18
20 -- a/a.go --
21 package a
22 -- b/go.mod --
23 module example.com/b
24
25 go 1.18
26
View as plain text