1 env GO111MODULE=on
2
3 # get should add modules needed to build packages, even if those
4 # dependencies are in sources excluded by build tags.
5 # All build tags are considered true except "ignore".
6 go mod init m
7 go get .
8 go list -m all
9 stdout 'example.com/version v1.1.0'
10 stdout 'rsc.io/quote v1.5.2'
11
12 -- empty.go --
13 package m
14
15 -- excluded.go --
16 // +build windows,mips
17
18 package m
19
20 import _ "example.com/version"
21
22 -- tools.go --
23 // +build tools
24
25 package tools
26
27 import _ "rsc.io/quote"
28
29 -- ignore.go --
30 // +build ignore
31
32 package ignore
33
34 import _ "example.com/doesnotexist"
35
View as plain text