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

     1  # Test support for go mod edit -go to set language version.
     2  
     3  env GO111MODULE=on
     4  ! go build
     5  stderr ' type alias requires'
     6  go mod edit -go=1.9
     7  grep 'go 1.9' go.mod
     8  go build
     9  
    10  # Reverting the version should force a rebuild and error instead of using
    11  # the cached 1.9 build. (https://golang.org/issue/37804)
    12  go mod edit -go=1.8
    13  ! go build
    14  stderr 'type alias requires'
    15  
    16  # go=none should drop the line
    17  go mod edit -go=none
    18  ! grep go go.mod
    19  
    20  -- go.mod --
    21  module m
    22  go 1.8
    23  
    24  -- alias.go --
    25  package alias
    26  type T = int
    27  

View as plain text