...

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

Documentation: cmd/go/testdata/script

     1# Tests golang.org/issue/47682
     2# Flags specified with -gcflags should appear after other flags generated by cmd/go.
     3
     4cd m
     5go build -n -gcflags=-lang=go1.17
     6stderr ' -lang=go1.16.* -lang=go1.17'
     7! go build -gcflags='-c 0'
     8stderr 'compile: -c must be at least 1, got 0'
     9
    10-- m/go.mod --
    11module example.com
    12
    13go 1.16
    14
    15-- m/main.go --
    16package main
    17
    18func main() {
    19    var s = []int{1, 2, 3}
    20    var pa = (*[2]int)(s[1:])
    21    println(pa[1])
    22}

View as plain text