aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_get_local.txt
blob: eb09da58b3e23404626e37993efd9747d0811ff1 (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
# Test 'go get' with a local module with a name that is not valid for network lookup.
[short] skip

env GO111MODULE=on
go mod edit -fmt
cp go.mod go.mod.orig

# 'go get -u' within the main module should work, even if it has a local-only name.
cp go.mod.orig go.mod
go get -d -u ./...
grep 'rsc.io/quote.*v1.5.2' go.mod
grep 'golang.org/x/text.*v0.3.0' go.mod
cp go.mod go.mod.implicitmod

# 'go get -u local/...' should be equivalent to 'go get -u ./...'
# (assuming no nested modules)
cp go.mod.orig go.mod
go get -d -u local/...
cmp go.mod go.mod.implicitmod

# For the main module, @patch should be a no-op.
cp go.mod.orig go.mod
go get -d -u local/...@patch
cmp go.mod go.mod.implicitmod

# 'go get -u -d' in the empty root of the main module should fail.
# 'go get -u -d .' should also fail.
cp go.mod.orig go.mod
! go get -u -d
! go get -u -d .

# 'go get -u -d .' within a package in the main module updates the dependencies
# of that package.
cp go.mod.orig go.mod
cd uselang
go get -u -d .
cd ..
grep 'rsc.io/quote.*v1.3.0' go.mod
grep 'golang.org/x/text.*v0.3.0' go.mod
cp go.mod go.mod.dotpkg

# 'go get -u -d' with an explicit package in the main module updates the
# dependencies of that package.
cp go.mod.orig go.mod
go get -u -d local/uselang
cmp go.mod go.mod.dotpkg

-- go.mod --
module local

require (
	golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c
	rsc.io/quote v1.3.0
)

-- uselang/uselang.go --
package uselang
import _ "golang.org/x/text/language"

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