aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_query_exclude.txt
blob: b0019694119bb17b2e95bfd180055aafc32daafb (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
46
env GO111MODULE=on

# list excluded version
go list -modfile=go.exclude.mod -m rsc.io/quote@v1.5.0
stdout '^rsc.io/quote v1.5.0$'

# list versions should not print excluded versions
go list -m -versions rsc.io/quote
stdout '\bv1.5.0\b'
go list -modfile=go.exclude.mod -m -versions rsc.io/quote
! stdout '\bv1.5.0\b'

# list query with excluded version
go list -m rsc.io/quote@>=v1.5
stdout '^rsc.io/quote v1.5.0$'
go list -modfile=go.exclude.mod -m rsc.io/quote@>=v1.5
stdout '^rsc.io/quote v1.5.1$'

# get excluded version
cp go.exclude.mod go.exclude.mod.orig
! go get -modfile=go.exclude.mod -d rsc.io/quote@v1.5.0
stderr '^go get: rsc.io/quote@v1.5.0: excluded by go.mod$'

# get non-excluded version
cp go.exclude.mod.orig go.exclude.mod
go get -modfile=go.exclude.mod -d rsc.io/quote@v1.5.1
stderr 'rsc.io/quote v1.5.1'

# get query with excluded version
cp go.exclude.mod.orig go.exclude.mod
go get -modfile=go.exclude.mod -d rsc.io/quote@>=v1.5
go list -modfile=go.exclude.mod -m ...quote
stdout 'rsc.io/quote v1.5.[1-9]'

-- go.mod --
module x

-- go.exclude.mod --
module x

exclude rsc.io/quote v1.5.0

-- x.go --
package x
import _ "rsc.io/quote"