summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/go/testdata/script/mod_fs_patterns.txt
blob: fd7de13002410325e21975c4cc3e32051309709b (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File system pattern searches should skip sub-modules and vendor directories.

env GO111MODULE=on

cd x

# all packages
go list all
stdout ^m$
stdout ^m/vendor$
! stdout vendor/
stdout ^m/y$
! stdout ^m/y/z

# path pattern
go list m/...
stdout ^m$
stdout ^m/vendor$
! stdout vendor/
stdout ^m/y$
! stdout ^m/y/z

# directory pattern
go list ./...
stdout ^m$
stdout ^m/vendor$
! stdout vendor/
stdout ^m/y$
! stdout ^m/y/z

# non-existent directory should not prompt lookups
! go build -mod=readonly example.com/nonexist
stderr 'import lookup disabled'

! go build -mod=readonly ./nonexist
! stderr 'import lookup disabled'
stderr '^can.t load package: package ./nonexist: cannot find package "." in:\n\t'$WORK'[/\\]gopath[/\\]src[/\\]x[/\\]nonexist$'

! go build -mod=readonly ./go.mod
! stderr 'import lookup disabled'
stderr 'can.t load package: package ./go.mod: cannot find package'

-- x/go.mod --
module m

-- x/x.go --
package x

-- x/vendor/v/v.go --
package v
import _ "golang.org/x/crypto"

-- x/vendor/v.go --
package main

-- x/y/y.go --
package y

-- x/y/z/go.mod --
syntax error!

-- x/y/z/z.go --
package z

-- x/y/z/w/w.go --
package w