1 env TESTGO_VERSION=go1.21.0
2 env TESTGO_VERSION_SWITCH=switch
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.
11 stderr '^go: rsc.io/future@v1.0.0: module rsc.io/future@v1.0.0 requires go >= 1.999 \(running go 1.21.0\)'
14 stderr '^go: rsc.io/future@v1.0.0: module rsc.io/future@v1.0.0 requires go >= 1.999 \(running go 1.21.0\)'
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\)'
20 # 'go get' should update the main module's go.mod file to a version compatible with the
21 # go version required for rsc.io/future, not fail.
23 stderr '^go: module rsc.io/future@v1.0.0 requires go >= 1.999; switching to go1.999testmod$'
24 stderr '^go: upgraded go 1.21 => 1.999$'
25 stderr '^go: added toolchain go1.999testmod$'
28 # Now, the various 'go mod' subcommands should succeed.
42 require rsc.io/future v1.0.0
46 import _ "rsc.io/future"