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

     1  # Test support for go mod -edit to set language version.
     2  
     3  env GO111MODULE=on
     4  ! go build
     5  stderr ' type aliases 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 aliases requires'
    15  
    16  
    17  -- go.mod --
    18  module m
    19  go 1.8
    20  
    21  -- alias.go --
    22  package alias
    23  type T = int
    24  

View as plain text