...
1go list ./p
2stdout 'example/p'
3
4! go list -json=ImportPath -test ./p
5cmp stderr wanterr.txt
6
7! go list -json=ImportPath,Deps -test ./p
8cmp stderr wanterr.txt
9
10! go list -json=ImportPath,Deps -deps -test ./p
11cmp stderr wanterr.txt
12
13! go list -json=ImportPath -deps -test ./p
14cmp stderr wanterr.txt
15
16-- wanterr.txt --
17go: can't load test package: package example/p
18 imports example/q
19 imports example/r
20 imports example/p: import cycle not allowed in test
21-- go.mod --
22module example
23go 1.20
24-- p/p.go --
25package p
26-- p/p_test.go --
27package p
28import "example/q"
29-- q/q.go --
30package q
31import "example/r"
32-- r/r.go --
33package r
34import "example/p"
View as plain text