1 # Regression test for https://go.dev/issue/54712: the "unix" build constraint
2 # was not applied consistently during package loading.
3
4 go list -x -f '{{if .Module}}{{.ImportPath}}{{end}}' -deps .
5 stdout 'example.com/version'
6
7 -- go.mod --
8 module example
9
10 go 1.19
11
12 require example.com/version v1.1.0
13 -- go.sum --
14 example.com/version v1.1.0 h1:VdPnGmIF1NJrntStkxGrF3L/OfhaL567VzCjncGUgtM=
15 example.com/version v1.1.0/go.mod h1:S7K9BnT4o5wT4PCczXPfWVzpjD4ud4e7AJMQJEgiu2Q=
16 -- main_notunix.go --
17 //go:build !(aix || darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris)
18
19 package main
20
21 import _ "example.com/version"
22
23 func main() {}
24
25 -- main_unix.go --
26 //go:build unix
27
28 package main
29
30 import _ "example.com/version"
31
32 func main() {}
33
View as plain text