aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/vendor_complex.txt
blob: 9ca94e72c527491faa16b909eb13da684a7fce5c (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
67
68
69
70
71
72
73
74
75
env GO111MODULE=off

# smoke test for complex build configuration
go build -o complex.exe complex
[exec:gccgo] go build -compiler=gccgo -o complex.exe complex

-- complex/main.go --
package main

import (
	_ "complex/nest/sub/test12"
	_ "complex/nest/sub/test23"
	"complex/w"
	"v"
)

func main() {
	println(v.Hello + " " + w.World)
}

-- complex/nest/sub/test12/p.go --
package test12

// Check that vendor/v1 is used but vendor/v2 is NOT used (sub/vendor/v2 wins).

import (
	"v1"
	"v2"
)

const x = v1.ComplexNestVendorV1
const y = v2.ComplexNestSubVendorV2

-- complex/nest/sub/test23/p.go --
package test23

// Check that vendor/v3 is used but vendor/v2 is NOT used (sub/vendor/v2 wins).

import (
	"v2"
	"v3"
)

const x = v3.ComplexNestVendorV3
const y = v2.ComplexNestSubVendorV2

-- complex/nest/sub/vendor/v2/v2.go --
package v2

const ComplexNestSubVendorV2 = true

-- complex/nest/vendor/v1/v1.go --
package v1

const ComplexNestVendorV1 = true

-- complex/nest/vendor/v2/v2.go --
package v2

const ComplexNestVendorV2 = true

-- complex/nest/vendor/v3/v3.go --
package v3

const ComplexNestVendorV3 = true

-- complex/vendor/v/v.go --
package v

const Hello = "hello"

-- complex/w/w.go --
package w

const World = "world"