aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_get_tags.txt
blob: e9869e3f0230b3ab6f6bdbb1f756071a2c624a1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
env GO111MODULE=on

[short] skip

# get should add modules needed to build packages, even if those
# dependencies are in sources excluded by build tags.
# All build tags are considered true except "ignore".
go mod init m
go get -d .
go list -m all
stdout 'example.com/version v1.1.0'
stdout 'rsc.io/quote v1.5.2'

[short] skip

# Packages that are only imported in excluded files should not be built.
env GOCACHE=$WORK/gocache  # Looking for compile commands, so need a clean cache.
go get -n -x .
stderr 'compile.* -p m '
! stderr 'compile.* -p example.com/version '
! stderr 'compile.* -p rsc.io/quote '

-- empty.go --
package m

-- excluded.go --
// +build windows,mips

package m

import _ "example.com/version"

-- tools.go --
// +build tools

package tools

import _ "rsc.io/quote"

-- ignore.go --
// +build ignore

package ignore

import _ "example.com/doesnotexist"