Debian Codegraph @

cmd/deadcode/testdata/issue73652.txtar

raw
1 # Test deadcode usage under go.work.
2
3 deadcode ./svc/... ./lib/...
4 want "unreachable func: A"
5
6 # different order of path under the same go.work should behave the same.
7
8 deadcode ./svc/... ./lib/...
9 want "unreachable func: A"
10
11
12 -- go.work --
13 go 1.18
14
15 use (
16 ./lib
17 ./svc
18 )
19
20 -- lib/go.mod --
21 module lib.com
22
23 go 1.18
24
25 -- lib/a/a.go --
26 package a
27
28 func A() {}
29
30 -- svc/go.mod --
31 module svc.com
32
33 go 1.18
34
35 -- svc/s/main.go --
36 package main
37
38 func main() { println("main") }
39