...

Text file src/cmd/go/testdata/script/mod_go_version.txt

Documentation: cmd/go/testdata/script

     1# Test support for declaring needed Go version in module.
     2
     3env GO111MODULE=on
     4env TESTGO_VERSION=go1.21
     5
     6! go list
     7stderr -count=1 '^go: sub@v1.0.0: module ./sub requires go >= 1.999 \(running go 1.21\)$'
     8! go build sub
     9stderr -count=1 '^go: sub@v1.0.0: module ./sub requires go >= 1.999 \(running go 1.21\)$'
    10
    11-- go.mod --
    12module m
    13go 1.1
    14require (
    15	sub v1.0.0
    16)
    17replace (
    18	sub => ./sub
    19)
    20
    21-- x.go --
    22package x
    23
    24-- sub/go.mod --
    25module sub
    26go 1.999
    27
    28-- sub/x.go --
    29package x

View as plain text