aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/get_vendor.txt
blob: 4ebb8a26b6dd3047872f6f8ccd566ce09fd50ab3 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[short] skip
env GO111MODULE=off

cd $GOPATH/src/v
go run m.go
go test
go list -f '{{.Imports}}'
stdout 'v/vendor/vendor.org/p'
go list -f '{{.TestImports}}'
stdout 'v/vendor/vendor.org/p'
go get -d
go get -t -d

[!net] stop
[!exec:git] stop

cd $GOPATH/src

# Update
go get 'github.com/rsc/go-get-issue-11864'
go get -u 'github.com/rsc/go-get-issue-11864'
exists github.com/rsc/go-get-issue-11864/vendor

# get -u
rm $GOPATH
mkdir $GOPATH/src
go get -u 'github.com/rsc/go-get-issue-11864'
exists github.com/rsc/go-get-issue-11864/vendor

# get -t -u
rm $GOPATH
mkdir $GOPATH/src
go get -t -u 'github.com/rsc/go-get-issue-11864/...'
exists github.com/rsc/go-get-issue-11864/vendor

# Submodules
rm $GOPATH
mkdir $GOPATH/src
go get -d 'github.com/rsc/go-get-issue-12612'
go get -u -d 'github.com/rsc/go-get-issue-12612'
exists github.com/rsc/go-get-issue-12612/vendor/golang.org/x/crypto/.git

# Bad vendor (bad/imp)
rm $GOPATH
mkdir $GOPATH/src
! go get -t -u 'github.com/rsc/go-get-issue-18219/bad/imp'
stderr 'must be imported as'
! exists github.com/rsc/go-get-issue-11864/vendor

# Bad vendor (bad/imp2)
rm $GOPATH
mkdir $GOPATH/src
! go get -t -u 'github.com/rsc/go-get-issue-18219/bad/imp2'
stderr 'must be imported as'
! exists github.com/rsc/go-get-issue-11864/vendor

# Bad vendor (bad/imp3)
rm $GOPATH
mkdir $GOPATH/src
! go get -t -u 'github.com/rsc/go-get-issue-18219/bad/imp3'
stderr 'must be imported as'
! exists github.com/rsc/go-get-issue-11864/vendor

# Bad vendor (bad/...)
rm $GOPATH
mkdir $GOPATH/src
! go get -t -u 'github.com/rsc/go-get-issue-18219/bad/...'
stderr 'must be imported as'
! exists github.com/rsc/go-get-issue-11864/vendor

-- v/m.go --
package main

import (
	"fmt"
	"vendor.org/p"
)

func main() {
	fmt.Println(p.C)
}
-- v/m_test.go --
package main
import (
	"fmt"
	"testing"
	"vendor.org/p"
)

func TestNothing(t *testing.T) {
	fmt.Println(p.C)
}
-- v/vendor/vendor.org/p/p.go --
package p
const C = 1