1 # go list all should work with GOOS=linux because all packages build on Linux
2 env GOOS=linux
3 env GOARCH=amd64
4 go list all
5
6 # go list all should work with GOOS=darwin, but it used to fail because
7 # in the absence of //go:build support, p looked like it needed q
8 # (p_test.go was not properly excluded), and q was Linux-only.
9 #
10 # Also testing with r and s that +build lines keep working.
11 env GOOS=darwin
12 go list all
13
14 -- go.mod --
15 go 1.17
16 module m
17
18 -- p/p.go --
19 package p
20
21 -- p/p_test.go --
22 //go:build linux
23
24 package p
25
26 import "m/q"
27
28 -- q/q_linux.go --
29 package q
30
31 -- r/r.go --
32 package r
33
34 -- r/r_test.go --
35 // +build linux
36
37 package r
38
39 import "m/s"
40
41 -- s/s_linux.go --
42 package s
43
View as plain text