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

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

View as plain text