blob: deff9358f060f462a74c0ab349a97139d553202e (
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
|
env GO111MODULE=on
# For this test module there are three versions:
# * v0.1.1-0.20190429073117-b5426c86b553
# * v0.1.0
# * v0.0.0-20190430073000-30950c05d534
# Only v0.1.0 is tagged.
#
# The v0.1.1 pseudo-version is semantically higher than the latest tag.
# The v0.0.0 pseudo-version is chronologically newer.
# Start at v0.1.1-0.20190429073117-b5426c86b553
go get example.com/pseudoupgrade@b5426c8
go list -m -u all
stdout '^example.com/pseudoupgrade v0.1.1-0.20190429073117-b5426c86b553$'
# 'get -u' should not downgrade to the (lower) tagged version.
go get -u
go list -m -u all
stdout '^example.com/pseudoupgrade v0.1.1-0.20190429073117-b5426c86b553$'
# 'get example.com/pseudoupgrade@upgrade' should not downgrade.
go get example.com/pseudoupgrade@upgrade
go list -m all
stdout '^example.com/pseudoupgrade v0.1.1-0.20190429073117-b5426c86b553$'
# 'get example.com/pseudoupgrade' should not downgrade.
# This is equivalent to 'get example.com/pseudoupgrade@upgrade'.
go get example.com/pseudoupgrade
go list -m all
stdout '^example.com/pseudoupgrade v0.1.1-0.20190429073117-b5426c86b553$'
# 'get example.com/pseudoupgrade@latest' should downgrade.
# @latest should not consider the current version.
go get example.com/pseudoupgrade@latest
go list -m all
stdout '^example.com/pseudoupgrade v0.1.0$'
# We should observe the same behavior with the newer pseudo-version.
go get example.com/pseudoupgrade@v0.0.0-20190430073000-30950c05d534
# 'get -u' should not downgrade to the chronologically older tagged version.
go get -u
go list -m -u all
stdout '^example.com/pseudoupgrade v0.0.0-20190430073000-30950c05d534$'
# 'get example.com/pseudoupgrade@upgrade should not downgrade.
go get example.com/pseudoupgrade@upgrade
go list -m -u all
stdout '^example.com/pseudoupgrade v0.0.0-20190430073000-30950c05d534$'
# 'get example.com/pseudoupgrade' should not downgrade.
go get example.com/pseudoupgrade
go list -m -u all
stdout '^example.com/pseudoupgrade v0.0.0-20190430073000-30950c05d534$'
# 'get example.com/pseudoupgrade@latest' should downgrade.
go get example.com/pseudoupgrade@latest
go list -m -u all
stdout '^example.com/pseudoupgrade v0.1.0$'
-- go.mod --
module x
go 1.12
-- main.go --
package x
import _ "example.com/pseudoupgrade"
|