1 env TESTGO_VERSION=go1.100.0
2 env TESTGO_VERSION_SWITCH=switch
3
4 go get [email protected]
5 stderr '^go: added toolchain go1.22.1$'
6 ! stderr '(added|removed|upgraded|downgraded) go'
7 grep 'toolchain go1.22.1' go.mod
8
9 go get toolchain@none
10 stderr '^go: removed toolchain go1.22.1$'
11 ! stderr '(added|removed|upgraded|downgraded) go'
12 ! grep toolchain go.mod
13
14 go get [email protected]
15 stderr '^go: added toolchain go1.22.1$'
16 ! stderr '(added|removed|upgraded|downgraded) go'
17 grep 'toolchain go1.22.1' go.mod
18
19 go get [email protected]
20 stderr '^go: upgraded go 1.10 => 1.22.3$'
21 ! stderr '^go: upgraded toolchain$'
22 grep 'go 1.22.3' go.mod
23
24 go get [email protected]
25 stderr '^go: added toolchain go1.100.0$'
26
27 go get [email protected] [email protected]
28 stderr '^go: removed toolchain go1.100.0$'
29 ! grep toolchain go.mod
30
31 go get [email protected] [email protected]
32 stderr '^go: downgraded go 1.22.3 => 1.22.1$'
33 stderr '^go: added toolchain go1.22.3$'
34 grep 'go 1.22.1' go.mod
35 grep 'toolchain go1.22.3' go.mod
36
37 go get [email protected] [email protected]
38 stderr '^go: upgraded go 1.22.1 => 1.22.3$'
39 stderr '^go: removed toolchain go1.22.3$'
40 grep 'go 1.22.3' go.mod
41 ! grep toolchain go.mod
42
43 go get [email protected]
44 stderr '^go: downgraded go 1.22.3 => 1.22.1$'
45 ! stderr toolchain # already gone, was not added
46 grep 'go 1.22.1' go.mod
47 ! grep toolchain go.mod
48
49 env TESTGO_VERSION=go1.22.1
50 env GOTOOLCHAIN=local
51 ! go get [email protected]
52 stderr 'go: updating go.mod requires go >= 1.22.3 \(running go 1.22.1; GOTOOLCHAIN=local\)$'
53
54 env TESTGO_VERSION=go1.30
55 go get [email protected]
56 grep 'toolchain go1.22.3' go.mod
57
58 go get [email protected]
59 grep 'go 1.22.1' go.mod
60 go get [email protected]
61 stderr '^go: upgraded go 1.22.1 => 1.23$'
62 stderr '^go: added m2 v1.0.0$'
63 grep 'go 1.23$' go.mod
64
65 go get [email protected] [email protected]
66 go get toolchain@none
67 stderr '^go: removed toolchain go1.23.9'
68 ! stderr ' go 1'
69 grep 'go 1.23.5' go.mod
70
71 go get [email protected] [email protected]
72 go get [email protected]
73 ! grep toolchain go.mod
74
75 -- go.mod --
76 module m
77 go 1.10
78
79 replace m2 v1.0.0 => ./m2
80
81 -- m2/go.mod --
82 module m2
83 go 1.23
84
View as plain text