...

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

Documentation: cmd/go/testdata/script

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

View as plain text