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

     1  # Test that dependencies can use Go language features newer than the
     2  # Go version specified by the main module.
     3  
     4  env GO111MODULE=on
     5  
     6  go build
     7  
     8  -- go.mod --
     9  module m
    10  go 1.12
    11  require (
    12  	sub.1 v1.0.0
    13  )
    14  replace (
    15  	sub.1 => ./sub
    16  )
    17  
    18  -- x.go --
    19  package x
    20  
    21  import "sub.1"
    22  
    23  func F() { sub.F(0, 0) }
    24  
    25  var A sub.Alias
    26  var D sub.Defined
    27  
    28  -- sub/go.mod --
    29  module m
    30  go 1.14
    31  
    32  -- sub/sub.go --
    33  package sub
    34  
    35  // signed shift counts added in Go 1.13
    36  func F(l, r int) int { return l << r }
    37  
    38  type m1 interface { M() }
    39  type m2 interface { M() }
    40  
    41  // overlapping interfaces added in Go 1.14
    42  type Alias = interface { m1; m2; M() }
    43  type Defined interface { m1; m2; M() }
    44  

View as plain text