aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_get_moved.txt
blob: 8430a737c40ca00842f14faede5001baa2f81a7e (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
env GO111MODULE=on
[short] skip

# A 'go get' that worked at a previous version should continue to work at that version,
# even if the package was subsequently moved into a submodule.
go mod init example.com/foo
go get -d example.com/split/subpkg@v1.0.0
go list -m all
stdout 'example.com/split v1.0.0'

# A 'go get' that simultaneously upgrades away conflicting package defitions is not ambiguous.
go get -d example.com/split/subpkg@v1.1.0

# A 'go get' without an upgrade should find the package.
rm go.mod
go mod init example.com/foo
go get -d example.com/split/subpkg
go list -m all
stdout 'example.com/split/subpkg v1.1.0'


# A 'go get' that worked at a previous version should continue to work at that version,
# even if the package was subsequently moved into a parent module.
rm go.mod
go mod init example.com/foo
go get -d example.com/join/subpkg@v1.0.0
go list -m all
stdout 'example.com/join/subpkg v1.0.0'

# A 'go get' that simultaneously upgrades away conflicting package definitions is not ambiguous.
# (A wildcard pattern applies to both packages and modules,
# because we define wildcard matching to apply after version resolution.)
go get -d example.com/join/subpkg/...@v1.1.0

# A 'go get' without an upgrade should find the package.
rm go.mod
go mod init example.com/foo
go get -d example.com/join/subpkg@v1.1.0
go list -m all
stdout 'example.com/join v1.1.0'