1 go list tool
2 stdout example.com/foo/cmd
3 stdout example.com/dependency/cmd/bar
4 go list all
5 stdout example.com/foo/cmd
6 stdout example.com/foo/lib
7 stdout example.com/dependency/cmd/bar
8
9 cd workspace
10 go list tool
11 stdout example.com/foo/cmd
12 stdout example.com/dependency/cmd/bar
13 stdout example.com/dependency/cmd/baz
14 go list all
15 stdout example.com/foo/cmd
16 stdout example.com/foo/lib
17 stdout example.com/other
18 stdout example.com/dependency/cmd/bar
19 stdout example.com/dependency/cmd/baz
20
21 cd ../invalid_path
22 ! go list all
23 stderr 'malformed tool path'
24
25 -- go.mod --
26 module example.com/foo
27
28 go 1.24
29
30 tool example.com/foo/cmd/eg
31 tool example.com/dependency/cmd/bar
32
33 replace example.com/dependency => ./dependency
34
35 require example.com/dependency v1.0.0
36
37 -- lib/main.go --
38 package lib
39
40 -- cmd/eg/main.go --
41 package main
42
43 func main(){}
44
45 -- dependency/go.mod --
46 module example.com/dependency
47
48 go 1.24
49 -- dependency/cmd/bar/main.go --
50 package main
51
52 func main(){}
53 -- dependency/cmd/baz/main.go --
54 package main
55
56 func main() {}
57 -- other/go.mod --
58 module example.com/other
59
60 go 1.24
61
62 tool example.com/dependency/cmd/baz
63
64 replace example.com/dependency => ../dependency
65
66 require example.com/dependency v1.0.0
67 -- other/lib.go --
68 package other
69 -- workspace/go.work --
70 go 1.24
71
72 use (
73 ../
74 ../other
75 )
76
77 -- invalid_path/go.mod --
78 module example.com/invalid_path
79
80 go 1.24
81
82 tool ./invalid_path
83
View as plain text