]> Cypherpunks.ru repositories - gostls13.git/blob - src/cmd/go/testdata/script/gotoolchain_modcmds.txt
83b75f0abbdea1f84e2a4c04ac2fc43263d1a1d7
[gostls13.git] / src / cmd / go / testdata / script / gotoolchain_modcmds.txt
1 env TESTGO_VERSION=go1.21.0
2 env TESTGO_VERSION_SWITCH=switch
3
4 # If the main module's go.mod file lists a version lower than the version
5 # required by its dependencies, the commands that fetch and diagnose the module
6 # graph (such as 'go mod download' and 'go mod graph') should fail explicitly:
7 # they can't interpret the graph themselves, and they aren't allowed to update
8 # the go.mod file to record a specific, stable toolchain version that can.
9
10 ! go mod download rsc.io/future@v1.0.0
11 stderr '^go: rsc.io/future@v1.0.0 requires go >= 1.999 \(running go 1.21.0\)'
12
13 ! go mod download rsc.io/future
14 stderr '^go: rsc.io/future@v1.0.0 requires go >= 1.999 \(running go 1.21.0\)'
15
16 ! go mod download
17 stderr '^go: rsc.io/future@v1.0.0: module rsc.io/future@v1.0.0 requires go >= 1.999 \(running go 1.21.0\)'
18
19 ! go mod verify
20 stderr '^go: rsc.io/future@v1.0.0: module rsc.io/future@v1.0.0 requires go >= 1.999 \(running go 1.21.0\)'
21
22 ! go mod graph
23 stderr '^go: rsc.io/future@v1.0.0: module rsc.io/future@v1.0.0 requires go >= 1.999 \(running go 1.21.0\)'
24
25
26 # 'go get' should update the main module's go.mod file to a version compatible with the
27 # go version required for rsc.io/future, not fail.
28 go get .
29 stderr '^go: module rsc.io/future@v1.0.0 requires go >= 1.999; switching to go1.999testmod$'
30 stderr '^go: upgraded go 1.21 => 1.999$'
31 stderr '^go: added toolchain go1.999testmod$'
32
33
34 # Now, the various 'go mod' subcommands should succeed.
35
36 go mod download rsc.io/future@v1.0.0
37 go mod download rsc.io/future
38 go mod download
39
40 go mod verify
41
42 go mod graph
43
44
45 -- go.mod --
46 module example
47
48 go 1.21
49
50 require rsc.io/future v1.0.0
51 -- example.go --
52 package example
53
54 import _ "rsc.io/future"